Package @google-cloud/firestore (5.0.2)

Classes

BulkWriter

A Firestore BulkWriter that can be used to perform a large number of writes in parallel.

BulkWriter

CollectionGroup

A CollectionGroup refers to all documents that are contained in a collection or subcollection with a specific collection ID.

CollectionGroup

CollectionReference

A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using the methods inherited from [Query]Query).

CollectionReference Query

DocumentChange

A DocumentChange represents a change to the documents matching a query. It contains the document affected and the type of change that occurred.

DocumentChange

DocumentReference

A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. A DocumentReference can also be used to create a [CollectionReference]CollectionReference to a subcollection.

DocumentReference

DocumentSnapshot

A DocumentSnapshot is an immutable representation for a document in a Firestore database. The data can be extracted with [data()] or [get(fieldPath)] to get a specific field.

For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the [exists] property to explicitly verify a document's existence.

DocumentSnapshot

FieldPath

A dot-separated path for navigating sub-objects (e.g. nested maps) within a document.

FieldValue

Sentinel values that can be used when writing documents with set(), create() or update().

FieldValue

Firestore

The Firestore client represents a Firestore Database and is the entry point for all Firestore operations.

GeoPoint

An immutable object representing a geographic location in Firestore. The location is represented as a latitude/longitude pair.

Query

A Query refers to a query which you can read or stream from. You can also construct refined Query objects by adding filters and ordering.

Query

QueryDocumentSnapshot

A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with [data()] or [get()] to get a specific field.

A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the [exists] property will always be true and [data()] will never return 'undefined'.

QueryDocumentSnapshot DocumentSnapshot

QueryPartition

A split point that can be used in a query as a starting and/or end point for the query results. The cursors returned by and can only be used in a query that matches the constraint of query that produced this partition.

QueryPartition

QuerySnapshot

A QuerySnapshot contains zero or more [QueryDocumentSnapshot]QueryDocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the [documents] property or enumerated using the [forEach] method. The number of documents can be determined via the [empty] and [size] properties.

QuerySnapshot

Timestamp

A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.

Transaction

A reference to a transaction.

The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()].

Transaction

WriteBatch

A Firestore WriteBatch that can be used to atomically commit multiple write operations at once.

WriteBatch

WriteResult

A WriteResult wraps the write time set by the Firestore servers on sets(), updates(), and creates().

WriteResult

Variables

DEFAULT_MAX_TRANSACTION_ATTEMPTS

DEFAULT_MAX_TRANSACTION_ATTEMPTS = 5

MAX_REQUEST_RETRIES

MAX_REQUEST_RETRIES = 5

Functions

setLogFunction(logger)

export declare function setLogFunction(logger: ((msg: string) => void) | null): void;

Sets or disables the log function for all active Firestore instances.

Parameter
NameDescription
logger((msg: string) => void) | null

A log function that takes a message (such as console.log) or null to turn off logging.

Returns
TypeDescription
void