Created
June 22, 2017 22:47
-
-
Save marti1125/b783660fdd7189591d2d9e72af0a0774 to your computer and use it in GitHub Desktop.
firebase get all rows
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
// get all rows | |
var query = firebase.database().ref("result").orderByKey(); | |
query.once("value") | |
.then(function(snapshot) { | |
snapshot.forEach(function(childSnapshot) { | |
// key will be "ada" the first time and "alan" the second time | |
var key = childSnapshot.key; | |
// childData will be the actual contents of the child | |
var childData = childSnapshot.val(); | |
console.log(childData) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment