‫Hello, my friends.
‫Let's talk about the Firestore hierarchy.
‫Cloud Firestore is NoSQL document oriented database.
‫Unlike a SQL database, there is no data tables or rows.
‫Instead, you store data in documents which are organized into collections.
‫Each document contains a set of key value pairs.
‫This is very important point.
‫Each document contains a set of key value pairs.
‫Cloud Firestore is optimized for storing large collections of small documents.
‫All documents must be stored in collections.
‫Also, this is a very important point.
‫All documents must be stored in collections.
‫We will see documents and collections in the next couple of minutes.
‫But.
‫I want from you to memorize that.
‫All documents must be stored in collections.
‫Documents can contain subcollections and nested objects, both of which can include primitive fields
‫like strings or complex objects like lists.
‫Real time collections and documents are created implicitly in cloud firestore.
‫Simply assign data to a data document within a collection if either the collection or document doesn't
‫exist.
‫Cloud storage and cloud Firestore will create.
‫Like this image chosen, showing us that the collection contains many documents.
‫Documents in cloud file Firestore.
‫The unit of storage is the document.
‫A document is a lightweight record that contains fields which map to values.
‫Each document is identified by a name.
‫A document representing a user might look like this.
‫User.
‫And here are the data fields.
‫The first, the last.
‫And the board.
‫And the values respectively.
‫While the collections are simply containers for documents.
‫So documents live in collections which are simply containers for documents.
‫For example, you could have a users collection to contain your various users, each represented by
‫a document.
‫This is the name of a collection.
‫Called users, and the first document is called user one, containing the data inside it.
‫And the second document is called User two.
‫I want from you to understand the difference between the collections and documents.
‫It's very simple.
‫Collection is is a container for documents and document is a container for data, which are the key
‫values and the key value pairs that we've talked about.
‫So this is the hierarchy of Firestore and the how we store documents and how we store data inside.