firebase database check if value exists

Solutions on MaxInterview for firebase database check if value exists by the best coders in the world

showing results for - "firebase database check if value exists"
Chiara
31 Jun 2018
1var ref = firebase.database().ref("users/ada");
2ref.once("value")
3  .then(function(snapshot) {
4    var a = snapshot.exists();  // true
5    var b = snapshot.child("name").exists(); // true
6    var c = snapshot.child("name/first").exists(); // true
7    var d = snapshot.child("name/middle").exists(); // false
8  });