Created
January 20, 2015 14:56
-
-
Save nickeblewis/f092fa42226bf5f738b0 to your computer and use it in GitHub Desktop.
Firebase - how to perform nested queries to get grandchildren who are equal to 10
This file contains hidden or 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
| var fathersRef = new Firebase('https://your.firebaseio.com'); | |
| fathersRef.on('child_added', function(fatherSnap) { | |
| fatherSnap.ref().on('child_added', function(childSnap) { | |
| childSnap.ref().orderByChild('age').equalTo(10).on('child_added', function(grandchildSnap) { | |
| \\ Do something with the grandchild | |
| var grandChild = grandchildSnap.val(); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment