Skip to content Skip to sidebar Skip to footer

Delete Entire Record Which Is Associated With A Certain Child Value

i want to delete the entire record in the database using the child value entered this is the code i tried for it User Name:

So in your case that'd be something like:

let password = "ddd"; // hard-coded value, but this could also be read from the HTMLletref = firebase.database().ref("users");
let query = ref.orderByChild("password").equalTo(password);

query.once("value").then(function(results) {
  results.forEach(function(snapshot) {
    snapshot.ref.remove();
  })
})

Post a Comment for "Delete Entire Record Which Is Associated With A Certain Child Value"