I want to filter questionCollection on basis of tagIDs . Everything working fine but whereArraycontains is working for max
The documentation for whereArrayContains queries is very specific. It can only work with 10 array items:
use the
array-contains-any
operator to combine up to 10array-contains
clauses on the same field with a logicalOR
You should know that whereArrayContains does not reduce the number of billed document reads. If your array contains 10 items, it will still cost 10 document reads. If you perform 10 whereArrayContains queries, each with 10 array items, it will still cost 100 reads.
If you need N documents, there is no shortcut to make those N document reads cost less than the cost of N document reads.