How to remove child nodes in firebase android?

Akhil picture Akhil · Mar 23, 2016 · Viewed 65.7k times · Source

I have a number of child nodes in my firebase db and I want to delete only one child node.

Firebase firebase=new Firebase("..address..");

firebase.push().setValue(classObj);

//here classObj is a class object which has a getter and setter for an integer id

Now that I have pushed multiple objects I want to delete only one based on the id in the classObj

Answer

Frank van Puffelen picture Frank van Puffelen · Mar 23, 2016

To remove data:

firebase.child(id).removeValue();

You might do well to have a look at the Firebase documentation for Android btw, which covers this and many more topics.