Firestore query subcollections

后端 未结 11 1579
余生分开走
余生分开走 2020-11-22 09:24

I thought I read that you can query subcollections with the new Firebase Firestore, but I don\'t see any examples. For example I have my Firestore setup in the following way

11条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 09:43

    Query limitations

    Cloud Firestore does not support the following types of queries:

    1. Queries with range filters on different fields.

    2. Single queries across multiple collections or subcollections. Each query runs against a single collection of documents. For more information about how your data structure affects your queries, see Choose a Data Structure.

    3. Logical OR queries. In this case, you should create a separate query for each OR condition and merge the query results in your app.

    4. Queries with a != clause. In this case, you should split the query into a greater-than query and a less-than query. For example, although the query clause where("age", "!=", "30") is not supported, you can get the same result set by combining two queries, one with the clause where("age", "<", "30") and one with the clause where("age", ">", 30).

提交回复
热议问题