Query a Firestore collection with a not eq filter

Query a Firestore collection with a not eq filter

Documentation pages that include this code sample

To view the code sample used in context, see the following documentation:

Code sample

Java

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

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

Node.js

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

PHP

$stateQuery = $citiesRef->where('capital', '!=', false);

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