Skip to content

Instantly share code, notes, and snippets.

@katowulf
Created December 29, 2017 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katowulf/0da6fa749aea3818555926526ca7bd98 to your computer and use it in GitHub Desktop.
Save katowulf/0da6fa749aea3818555926526ca7bd98 to your computer and use it in GitHub Desktop.
{
"albums": {
"key1": {
"owner": "uid1",
"subscribers": {
"uid1": true,
"uid2": true
}
}
}
}
// Since we've used the unique identifier instead of a push id, we can query as follows
const query = firebase.database().ref('albums').orderByChild('subscribers/uid1').equalTo(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment