Skip to content

Instantly share code, notes, and snippets.

@sbatson5
Last active February 26, 2020 09:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbatson5/f0c58194c976133d403d5e2a810378dd to your computer and use it in GitHub Desktop.
Save sbatson5/f0c58194c976133d403d5e2a810378dd to your computer and use it in GitHub Desktop.
Multiple firestore queries
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