I would like to know if a firestore collection of 10K records can support a query with 5 between filters. Eg.
Where (field_1 >= min_a and field_1 <= max_a) and
(field_2 >= min_b and field_2 <= max_b) and
(field_3 >= min_c and field_3 <= max_c) and
(field_4 >= min_d and field_4 <= max_d) and
(field_5 >= min_e and field_5 <= max_e)
Will I run into and index or query limitations?
2
Answers
Apparently this isn't possible. The docs states
In a compound query, range (<, <=, >, >=) and not equals (!=, not-in) comparisons must all filter on the same field.
Update: I had missed that you’re performing the range conditions on different fields. That is not supported, as shown in the documentation I linked.
Since you only have
AND
clauses you should not be hitting any limits. You will need to have an index that matches all the fields though, but the SDKs will raise an error if the necessary index is missing.See the documentation for a list of the limitations on Firestore’s query capabilities