From the course: Angular: Cloud-Powered Apps with Firebase

Cloud Firestore intro

From the course: Angular: Cloud-Powered Apps with Firebase

Start my 1-month free trial

Cloud Firestore intro

- [Instructor] I sure hope you have already been impressed with the powerful features that Firebase provides. We have easily added authentication to our app that otherwise would have taken a really long time to implement ourselves. But now it's time to start working with data. Cloud Firestore is a flexible, scalable, NoSQL cloud database to store and sync data for client and server side development. This data can be accessed directly via native, as the case. It ships the comprehensive set of security rules, so you can access your database without needing to set up your own server. And also, it will allow us to sync data across devices. The Cloud's Firestore model is document oriented. So there aren't any tables or rows like in a SQL database. Instead, we store data in documents, which are then organized into collections. Let's start with the document. It would be the unit of storage when working with Cloud Firestore. It is identified by name and it contains field value pairs. The values support many data types, Boolean, number, string, geopoint, binary blob, and timestamp. You can also use arrays or nested objects, called maps, to structure data within a document. You can also organize more complex data as shown here. You can see that it resembles a plain JavaScript object. Now let's talk about collections. Documents are organized into collections. You can imagine that we have a Users collection for all of our registered users. When working with Cloud Firestore in our app, we will be able to both create a reference directly to a document or directly to a collection. It is also worth mentioning that you can organize your data into sub-collections as needed, as shown in this diagram.

Contents