My query is:
snapshot = await FirebaseFirestore.instance
.collection('dialogs')
.where('active', isEqualTo: true)
.where('users', arrayContains: globals.user.userId)
.where('readers', whereNotIn: [globals.user.userId])
.orderBy('priority')
.limit(1)
.get();
I'm getting the above exception:
Unhandled Exception: [cloud_firestore/unknown] An error occurred while parsing query arguments, see native logs for more information.
I have found some notes on the official Firestore documentation:
- You can use at most one in,
not-in, orarray-contains-anyclause per query. You can't combine these operators in the same query. - You can't combine not-in with not equals !=.
All should be just fine in my case.
Also I have tried several things:
- If I remove only the
whereNotInline, everything is just fine. - if I remove only the
arrayContainsline, everything is just fine.
Why am I getting a query parsing exception? Thanks
