In Firestore, how can you do a compound query involving a key in a map without creating an index for every key?
For example, consider a collection which holds blog posts
Try restructuring your data store. Firebase documentation is very helpful here.
Query limitations
Cloud Firestore does not support the following types of queries:
- Queries with range filters on different fields, as described in the previous section.
- 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.
- Queries of individual array members. You can, however, model and query array-like data using the techniques in Working with Arrays, Lists, and Sets.
- Logical OR queries. In this case, you should create a separate query for each OR condition and merge the query results in your app.
- 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).