tittimous
tittimous

Reputation: 39

Deleting all entries with a specific child

I'm trying to delete all of the entries in my Firebase that have the child parameter

isGroup: true;

is there any way to do this simply?

Upvotes: 0

Views: 28

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598728

Something like this should do the trick:

var ref = ...
var query = ref.orderByChild("isGroup").equalTo(true);
query.once("value", function(snapshot) {
  snapshot.forEach(function(child) {
    child.ref.remove()
  });
});

Upvotes: 1

Related Questions