Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. // with once('value')
  2. firebase().database().ref('/dinosaurs').orderByChild('height').once('value', function (snapshot) {
  3. snapshot.forEach(function(child) {
  4. console.log(child.val())
  5. });
  6. });
  7.  
  8. // OR with once('child_added')
  9. firebase().database().ref('/dinosaurs').orderByChild('height').once('child_added', function (snapshot) {
  10. console.log(snapshot.val());
  11. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement