Firestore

import paths

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

"firebase-admin/firestore" // server SDK

We create a db object that embeds the config, and provide it to the firestore functions.

const db = getFirestore(app)

conceptual overview

Collection

A set of documents

Document

A set of fields. A document may contain 20k fields and 1 megabyte data.

Reference to a document or to a collection

A reference serves to identify an item but does not guarantee the item existence (underlying collection, or underlying document). That is, the item either exists or is a tentative item.

It is built with the item's path or ID.

earlymorning logo

© 2025 - All rights reserved

Firestore

import paths

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

"firebase-admin/firestore" // server SDK

We create a db object that embeds the config, and provide it to the firestore functions.

const db = getFirestore(app)

conceptual overview

Collection

A set of documents

Document

A set of fields. A document may contain 20k fields and 1 megabyte data.

Reference to a document or to a collection

A reference serves to identify an item but does not guarantee the item existence (underlying collection, or underlying document). That is, the item either exists or is a tentative item.

It is built with the item's path or ID.