I try to fetch data from Firestore with a whereGreaterThan
and whereArrayContains compound query. For some reason, this combination does not seem to work. If I omit one of the two statements they work and return almost the same data.
someCollection
?.whereGreaterThan("date", Date().startOfPreviousMonth)
?.whereArrayContains("ids", id)
?.get()
?.addOnSuccessListener { .... }
?.addOnFailureListener { .... }
In the documentation it is only stated that there are only these restrictions for compound queries:
Limitations
Note the following limitations for != queries:
- Only documents where the given field exists can match the query.
- You can't combine not-in and != in a compound query.
- In a compound query, range (<, <=, >, >=) and not equals (!=, not-in) comparisons must all filter on the same field.
For me, no one of these matches my problem. Any suggestions?