Firestore
conceptual
Firestore is a database made of schema-less collections and documents. It is a NoSQL database that is 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...). A document has up to 20k fields and stores up to 1 MiB of data.
A reference serves to identify a collection or a document in the database. It doesn't guarantee the collection or document existence: It's merely a path that may point to nothing.
firestore reference
firebase-admin is a wrapper around @google-cloud/firestore. It has the same syntax and capabilities.
import paths
"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)