Removing data

Removing data is simple. We need to split this up into two different parts, as they differ a bit, to remove for an object and to remove an item in a list.

There are different ways of subscribing to data in Firebase. You can either subscribe to changes, using a method called valueChanges(). This will give you the data you want to display. As long as you want to display data, then you are fine using this method. However, when you start to want to change specific data like removing an item in a list or in short, when you need to know the exact key value of the resource you are trying to manipulate, then you need a new function. This function is called snapshotChanges()Using said function gives you a more raw version of the resource you want. In this case, you need to dig out the value that you want to display. 

Let's start with the first case, that of removing an object.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset