June 2018
Beginner to intermediate
394 pages
9h 2m
English
To delete data, you can call the removeValue() method onto database reference. You can likewise pass null to the setValue() method, which does the same delete operation:
//Removes the entire childmDbRef.child(userId).removeValue();//Passing null to remove the caluemDbRef.chile(userId).child("name").setValue(null);// Similarly Hashmap can also be removedMap<String, Object> mHashmap = new HashMap<>();mHashmap.put("Name 1/title", null);mHashmap.put("Name 1/content", null);mHashmap.put("Name 2/title", null);mHashmap.put("Name 2/content", null);
The following screenshot shows the Firebase console reaction for the delete operation:
Read now
Unlock full access