Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid query. You cannot use more than one 'in' filter

this.ref.collection("users", ref => ref.where("uid1","in", [reciverId, senderId])
        .where("uid2","in", [reciverId, senderId]))

give me error like

"Invalid query. You cannot use more than one 'in' filter"

like image 558
Jolen Qadar Avatar asked Mar 01 '20 11:03

Jolen Qadar


People also ask

How to use multiple fields to filter records in filter query?

Currently, available feature is to configure a single condition in Filter Query to filter records, and use Order by to sort the filtered records. The premise is that the field name does not contain spaces or other special symbols. For using multiple fields to filter records, please consider implementing this in Filter array-advanced mode.

Can MS flow support multiple conditions in a filter query?

Use List rows present in a table action to sort, use Filter array to filter, although the order of action changes, but the final result is the same. In addition to the feature to configure multiple conditions in Filter Query, please consider submitting your idea in Flow ideas forum to allow MS Flow to support such functionality:

Can I use more than one'array-contains'filter in FireStore?

You cannot use more than one 'array-contains' filter. Luckily, now, Firestore has a solution for that. If you need to query documents that have at least one of specified tags, then you can use the latest addition to Firestore, array-contains-any where filter:

What is a filter query in SQL Server?

Filter query= contains (textfield1name,’value1′) and contains (textfield1name,’value2′) e.g. if I have to filter where ‘Topic’ contains ‘New’ and ‘Interested’; my filter would be contains (subject,’new’) and contains (subject,’interested’) Filter query= optionsetfieldname1 eq optionsetnumericvalue1 or optionsetfieldname1 eq optionsetnumericvalue2


Video Answer


1 Answers

This is indeed a limitation of Firestore, as explained in the documentation:

Limitations

Note the following limitations for in and array-contains-any:

  • in and array-contains-any support up to 10 comparison values.
  • 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.
  • You can combine array-contains with in but not with array-contains-any.
like image 63
Renaud Tarnec Avatar answered Oct 20 '22 19:10

Renaud Tarnec