Query Step 7

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

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);

Q&A Chat