Last active
February 26, 2020 09:35
-
-
Save sbatson5/f0c58194c976133d403d5e2a810378dd to your computer and use it in GitHub Desktop.
Multiple firestore queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const firebase = require('firebase'); | |
function getCurrentEventsByStateForAdmins(state) { | |
const db = firebase.firestore(); | |
db.collection('events') | |
.orderBy('expirationDate', 'asc') | |
.where('expirationDate', '>', new Date().toISOString()) | |
.where('state', '==', state) | |
.where('isAdmin', '==', true) | |
.get() | |
.then((querySnapshot) => { | |
// do some logic here | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment