In a Firebase project, which is the entry point for any Firebase service that you want to implement into your app, you can create a Firebase Firestore database, which is a NoSQL database that stores data in the cloud.
In a Firestore hierarchy, databases contain Collections, which, in turn, contain Documents. Documents contain key-value pairs. There are a few rules you should be aware of when designing a Firestore database:
- The Firestore root can contain collections but cannot contain documents.
- Collections must contain documents, not other collections.
- Each document can take up to 1 MB.
- Documents cannot contain other documents.
- Documents CAN contain collections
- Each document has a documentID: documentID is a unique identifier of each document in a collection.
To sum things up, the hierarchy of Firestore data is as follows:
Database > Collection > Document > key-value
All methods in a Firebase Firestore database are asynchronous.
In the code you have written...