Created
June 24, 2014 04:49
-
-
Save greggnakamura/c21736004a9306e1b4b5 to your computer and use it in GitHub Desktop.
Firebase: snapshot functions
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
/* Firebase snapshot */ | |
snapshot.val() | |
- Return values from Firebase at a given point in time | |
snapshot.hasChildren(); | |
snapshot.hasChild('text'); | |
snapshot.name(); | |
- Get name of snapshot | |
snapshot.numChildren('text'); | |
snapshot.forEach(function(item){ | |
console.log(item.val()); | |
console.log(item.name() + ' - ' + item.val()); | |
console.log(item.ref()); // Firebase reference | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment