Query a Firestore collection with an in filter

Query a Firestore collection with an in filter

Code sample

Go

cities := client.Collection("cities")
query := cities.Where("country", "in", []string{"USA", "Japan"}).Documents(ctx)

Java

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

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

Node.js

const usaOrJapan = await citiesRef.where('country', 'in', ['USA', 'Japan']).get();

Python

cities_ref = db.collection(u'cities')

query = cities_ref.where(u'country', u'in', [u'USA', u'Japan'])
return query