runTransaction
Executes the given updateFunction
and then attempts to commit the changes
applied within the transaction. If any document read within the transaction
has changed, Cloud Firestore retries the updateFunction
. If it fails to
commit after 5 attempts, the transaction fails.
The maximum number of writes allowed in a single transaction is 500.
function runTransaction<T>(
firestore: Firestore,
updateFunction: (transaction: Transaction) => Promise<T>,
options?: TransactionOptions,
): Promise<T>;§
runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T>, options?: TransactionOptions): Promise<T>
[src]§Parameters
§
updateFunction: (transaction: Transaction) => Promise<T>
[src]- The function to execute within the transaction context.
§
options?: TransactionOptions optional
[src]- An options object to configure maximum number of attempts to commit.