Ir a la consola

A write batch, used to perform multiple writes as a single atomic unit.

A WriteBatch object can be acquired by calling Firestore.batch(). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until WriteBatch.commit() is called.

Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data.

Index

Constructors

Methods

Constructors

Private constructor

Methods

commit

  • commit(): Promise<void>
  • Commits all of the writes in this write batch as a single atomic unit.

    Returns Promise<void>

    A Promise resolved once all of the writes in the batch have been successfully written to the backend as an atomic unit. Note that it won't resolve while you're offline.

delete