From the docs:
You can also chain multiple where() methods to create more specific queries (logical AND).
How can I perform an OR
query?
Example:
status
is open
OR upcoming
status == open
OR createdAt <= <somedatetime>
OR
isn't supported as it's hard for the server to scale it (requires keeping state to dedup). The work around is to issue 2 queries, one for each condition, and dedup on the client.
Edit (Nov 2019):
Cloud Firestore now supports IN
queries which are a limited type of OR
query.
For the example above you could do:
// Get all documents in 'foo' where status is open or upcmoming
db.collection('foo').where('status','in',['open','upcoming']).get()
However it's still not possible to do a general OR
condition involving multiple fields.