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
The simplest way to delete data is to call remove() on a reference to the location of that data. You can also delete by specifying null as the value for another write operation such as set() or update() . You can use this technique with update() to delete multiple children in a single API call.
Calling removeEventListener() removes the listener from that location. It will stop firing events after it has completed them for data it's already received. If you're still getting calls to the listener, something else is going on that is unfortunately impossible to say from the code you shared.
Sign in to Firebase, then open your project. , then select Project settings. In the Your apps card, select the app that you want to delete. Under the Your apps card, click Remove this app.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With