How to perform compound queries with logical OR in Cloud Firestore?

后端 未结 9 2007
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 02:07

From the docs:

You can also chain multiple where() methods to create more specific queries (logical AND).

How can I perform an <

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 02:34

    With the recent addition of IN queries, Firestore supports "up to 10 equality clauses on the same field with a logical OR"

    A possible solution to (1) would be:

    documents.where('status', 'in', ['open', 'upcoming']);
    
    

    See Firebase Guides: Query Operators | in and array-contains-any

提交回复
热议问题