Skip to Content
Serverless Web Applications with React and Firebase
book

Serverless Web Applications with React and Firebase

by Mayur Tanna, Harmeet Singh
April 2018
Intermediate to advanced content levelIntermediate to advanced
284 pages
6h 43m
English
Packt Publishing
Content preview from Serverless Web Applications with React and Firebase

Writing the data

In Firebase, we have four methods available to write a data into the Firebase database:

set( ) Write or replace data to a defined path, like messages/tickets/<uid>.
update( ) Update to specific children of node without replacing the other child nodes. We can also use the update method to update the data into multiple locations.
push( ) To add a list of data in the database, we can use the push() method; it generates a unique ID every time when it calls, such as helpdesk/tickets/<unique-user-id>/<unique-ticket-id>.
transaction( ) We can use this method when we are working with complex data that can be corrupted by concurrent updates such as incremental counters.

 

Now, let's take a look at how data is structured ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Web Applications with Firebase

Building Web Applications with Firebase

Gareth Brown
React Native in Action

React Native in Action

nader dabit, Nickie Buckner

Publisher Resources

ISBN: 9781788477413Supplemental Content