I'm querying two fields in a document. I'm using the whereIn
(that's what it's called in flutter, for web it's called in
) operator for one field. The other field I need to query is a string. And I want to query this value against two values. Do I need to separate the queries or is there a way to do the full query in a single query..
Asked
Active
Viewed 93 times
0

flutter
- 6,188
- 9
- 45
- 78
1 Answers
1
According to the Firestore documentation on query limitations:
You can use only one
in
orarray-contains-any
clause per query. You can't use bothin
andarray-contains-any
in the same query.
Since you need two whereIn
/in
clauses, you need to execute a separate query for each value in the second whereIn
and then merge the results in your application code.

Frank van Puffelen
- 565,676
- 79
- 828
- 807
-
I just noticed that Peter showed the exact same quote in his answer to [your previous question](https://stackoverflow.com/questions/61561868/is-firebase-getdocument-run-line-by-line/61564335#61564335), so I'm not sure what your additional ask here is in top of that. – Frank van Puffelen Jul 18 '20 at 14:29