Query a Firestore collection with a not eq filter

Query a Firestore collection with a not eq filter

Code sample

Java

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

Query query = citiesRef.whereNotEqualTo("capital", false);

Node.js

const capitalNotFalseRes = await citiesRef.where('capital', '!=', false).get();

Ruby

cities_ref = firestore.col collection_path
query = cities_ref.where "capital", "!=", false

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser