Go to console

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 Firestore.runTransaction().

Index

Constructors

Methods

Constructors

Private constructor

Methods

delete

  • delete(documentRef: DocumentReference): Transaction
  • Deletes the document referred to by the provided DocumentReference.

    Parameters

    Returns Transaction

    This Transaction instance. Used for chaining method calls.

get

set

  • set(documentRef: DocumentReference, data: DocumentData, options?: SetOptions): Transaction
  • Writes to the document referred to by the provided DocumentReference. If the document does not exist yet, it will be created. If you pass SetOptions, the provided data can be merged into the existing document.

    Parameters

    • documentRef: DocumentReference

      A reference to the document to be set.

    • data: DocumentData

      An object of the fields and values for the document.

    • Optional options: SetOptions

      An object to configure the set behavior.

    Returns Transaction

    This Transaction instance. Used for chaining method calls.

update

  • update(documentRef: