Based on new version of firebase dependencies in flutter, there is new filters such like isNotEqualTo, arrayContains, arrayContainsAny, whereIn and so on.
I try to create streambuilder with some filters, I want to get documents that matches these conditions.
- The "uid" field value Does not equal current uid. (isNotEqualTo)
- The "school" field value isEqualTo current user school.(isEqualTo)
- The "random" field value isGreaterThanOrEqualTo random number that the app generated it (isGreaterThanOrEqualTo)
stream: fireStore.collection(USERS_COLLECTION).where(UID_FIELD, isNotEqualTo: me.uid).where(SCHOOL_FIELD, isEqualTo: me.school).where(RANDOM_FIELD, isGreaterThanOrEqualTo: random).limit(10).snapshots(),
Condition 1 (isNotEqualTo) does not work with me, but 2 and 3 it's working fine, when I add the filter 1 there is error showing to me.
All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on 'FieldPath([uid])' and 'FieldPath([random])'. 'package:cloud_firestore/src/query.dart': Failed assertion: line 486 pos 18: 'hasInequality == field'