Firebase Firestore
Build on the fundamentals of Firebase by learning how to use Firestore.
Firestore is a real-time data store that we can use for our application data.
Integrating and using Firestore in our application involves the following steps:
- Creating a project on Firebase Console
- Creating a Cloud Firestore database on Firebase Console
- Adding and initializing Firebase in the app
- Fetching and storing the data
Creating a project on Firebase Console
We can create a project by following the steps discussed in the previous lesson.
Creating a Cloud Firestore database on Firebase Console
To start using the Firestore service, we’ll have to create our new database in the Cloud Firestore Console.
Under the “Build” menu on the sidebar of Firebase Console, select “Firestore Database.”
Click the “Create Database” button
Set the rules for your database access. Start in production mode if you want your data to be private by default. Start in test mode if you want to enable quick setup and have your database open by default.
Select the region/location of your database. Ideally, your database should be where most of your app’s users are.
Create your first collection. Start with the threads collection.
Create your first document in your database collection.
To add new collections to your database, click the “Start” collection and repeat steps 5 and 6.