GeoFlutterFire icon indicating copy to clipboard operation
GeoFlutterFire copied to clipboard

logical "or" query

Open juju-ba opened this issue 5 years ago • 1 comments

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?

juju-ba avatar Jan 09 '20 13:01 juju-ba

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.

lukestokes94 avatar Feb 05 '20 09:02 lukestokes94