Updating and deleting data from our Realtime Database
The update/delete functionalities are widely present in all the applications. It's simply our way to alter the data or remove it for good. So let's see how we can incorporate such functionalities over our application.
How to do it...
We will take a look at updating data first.
Updating data over Firebase was always a point of debate and discussion over StackOverflow; so for that, let's just explain the two principles over the new APIs and see how they differ from each other:
- The
update()
function will give us the option to send simultaneous update calls to our database, and won't do anything besides the expected behavior of an update function, that is, updating the data without altering the reference of the record. - The
set()
function, within its behavior, changes the reference to the data itself while replacing it with a new one. - What matters the most for us is the behavior we seek, so the
Update
function is the most suitable function call...