Query How to query collections of documents.

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.
Get Unlimited PRO Access

OR


*Enrollment provides full access to this course (and updates) for life.

Examples of how to make queries in Firestore that resemble SQL.

file_type_js_official firestore.js
// Basic Where
const rangeQuery = db.collection('users').where('age', '>=', 21);

// AND
const andQuery = db.collection('users')
                .where('age', '==', 21)
                .where('sex', '==', 'M')


// OR
const q1 = db.collection('users').where('age', '==', 21);
const q2 = db.collection('users').where('age', '==', 25);


// NOT
const not1 = db.collection('users').where('age', '>', 21);
const not2 = db.collection('users').where('age', '<', 21);

Questions?

Ask questions via GitHub below OR chat on Slack #questions