I see having mulitple where
acts like AND
, but how about OR
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can't really do an OR query in Cloud Firestore.
As a workaround, you could run two separate queries and merge them together on the client, or add some custom field that would essentially perform the "OR" query for you on the database. (For an example of that latter one, if you know you're going to often run an "age > 65 OR age < 18" query on the database, you could create a specific age_high_or_low
field that you would set to true if the age field were greater than 65 or less then 18.)