October 2017
Intermediate to advanced
302 pages
7h 27m
English
To write to the Firebase database, first we grab an instance of it, with firebase.database(). Similar to firebase.auth(), this instance comes with some built-in methods we can use.
The one we will be dealing with in this book is firebase.database().ref(refName). Ref stands for reference, but might be better thought of as a category of our data (in SQL databases, what might make up a table).
If we want to grab the reference to our users, we use firebase.database().ref(‘/users’). For messages, it’s firebase.database().ref(‘/messages’)... and so on. We can now act on this reference in a variety of ways, such as listening to changes (coming later in the chapter), or pushing new data in (which we'll handle right now ...
Read now
Unlock full access