DarshanGowda0 / GeoFlutterFire

:fire:GeoFlutterFire:fire: is an open-source library that allows you to store and query firestore documents based on their geographic location.
https://youtu.be/MYHVyl-juUk
MIT License
305 stars 260 forks source link

logical "or" query #75

Open juju-ba opened 4 years ago

juju-ba commented 4 years ago

Is there any way to query with a logical "or" like described in firebase docs?

`CollectionReference citiesRef = db.collection("cities");

Query query = citiesRef.whereIn("country", Arrays.asList("USA", "Japan"));`

I'm getting "The method 'whereIn' isn't defined for the class 'CollectionReference'."

If not, how can I achieve this in another way?

lukestokes94 commented 4 years ago

This seems more like a FlutterFire question than Geoflutterfire, but to answer your question, 'whereIn' can be used as such:

_firestore.collection('example') .where('field', whereIn: List) .snapshots(),

If you can't access the whereIn method make sure you're on the latest version of CloudFirestore - the documentation for this is here.