Firestore

links

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 because Firestore APIs require it.

const db = getFirestore(app)

Overview

collection

A collection is a set of documents

Document

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

Reference

A reference does not guarantee the underlying item existence (underlying collection, or underlying document).

It serves to identify a tentative item.

It is built with, and later contains, the id and/or path that identifies the tentative item.

earlymorning logo

© 2025 - All rights reserved

Firestore

links

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 because Firestore APIs require it.

const db = getFirestore(app)

Overview

collection

A collection is a set of documents

Document

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

Reference

A reference does not guarantee the underlying item existence (underlying collection, or underlying document).

It serves to identify a tentative item.

It is built with, and later contains, the id and/or path that identifies the tentative item.