Understanding the Cloud Firestore Structure

Get a better understanding of the Cloud Firestore structure in this lesson.

The Cloud Firestore Data model

Cloud Firestore is a document-model database that uses a hierarchical data structure to store data. We can store data in Cloud Firestore as documents, collections, or subcollections.:

Documents

A document is a lightweight unit of storage made up of a set of key-value pairs. Each document in the database is identified by a name and supports various data types—strings, numbers, booleans, arrays, nested objects (called maps)—and subcollections. Data stored in documents typically looks like JSON and can therefore be treated as lightweight JSON records. The illustration below shows two Firestore documents, message1 and message2, containing data.

Get hands-on with 1200+ tech skills courses.