Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

firebase database check if value exists

var ref = firebase.database().ref("users/ada");
ref.once("value")
  .then(function(snapshot) {
    var a = snapshot.exists();  // true
    var b = snapshot.child("name").exists(); // true
    var c = snapshot.child("name/first").exists(); // true
    var d = snapshot.child("name/middle").exists(); // false
  });
Source by firebase.google.com #
 
PREVIOUS NEXT
Tagged: #firebase #database #check #exists
ADD COMMENT
Topic
Name
5+4 =