0

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..

flutter
  • 6,188
  • 9
  • 45
  • 78

1 Answers1

1

According to the Firestore documentation on query limitations:

You can use only one in or array-contains-any clause per query. You can't use both in and array-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