Firebase OR queries are available from version 4.5.0 in the Flutter cloud_firestore package. I'm using cloud_firestore: 4.8.2 but my OR query does not work. Here is my code:
final ref = FirebaseFirestore.instance.collection('users');
final query = await ref.where(
Filter.or(
Filter('followerCount', isGreaterThanOrEqualTo: followerCount),
Filter('followingCount', isGreaterThanOrEqualTo: followingCount),
),
).get();
It seems code is right according to this comment on GitHub:
https://github.com/firebase/flutterfire/pull/10678#issuecomment-1490300789
But I am getting this error instead:
FirebaseError: Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on 'followerCount' and 'followingCount'
Any thoughts?