Firestore

conceptual

Firestore is a schema-less database made of collections and documents of loose shape (NoSQL), most similar to MongoDB.

  • A collection is a set of documents.
  • A document is a set of fields holding primitive data types (number, string, timestamps...) or object types (maps and arrays). A document has up to 20k fields and stores up to 1 MiB of data.
  • A reference serves to refer to a collection or to a document. It doesn't guarantee the collection or document's existence in the database: It's merely a path that points to a location.

import paths and documentation

We interact with the database with the client SDK or with the admin SDK. The admin SDK's firestore sub-package is a wrapper around a google-cloud package: It has the same syntax and capabilities.

"firebase/firestore" // client SDK
"firebase/firestore/lite" // client SDK

"firebase-admin/firestore" // admin SDK

helper object

We init a db object, for use in Firestore-related functions.

// const app = initializeApp()
const db = getFirestore(app)
earlymorning logo

Firestore

conceptual

Firestore is a schema-less database made of collections and documents of loose shape (NoSQL), most similar to MongoDB.

  • A collection is a set of documents.
  • A document is a set of fields holding primitive data types (number, string, timestamps...) or object types (maps and arrays). A document has up to 20k fields and stores up to 1 MiB of data.
  • A reference serves to refer to a collection or to a document. It doesn't guarantee the collection or document's existence in the database: It's merely a path that points to a location.

import paths and documentation

We interact with the database with the client SDK or with the admin SDK. The admin SDK's firestore sub-package is a wrapper around a google-cloud package: It has the same syntax and capabilities.

"firebase/firestore" // client SDK
"firebase/firestore/lite" // client SDK

"firebase-admin/firestore" // admin SDK

helper object

We init a db object, for use in Firestore-related functions.

// const app = initializeApp()
const db = getFirestore(app)