diff --git a/packages/firebase/index.d.ts b/packages/firebase/index.d.ts index f5057a27daa..f9cfc55660e 100644 --- a/packages/firebase/index.d.ts +++ b/packages/firebase/index.d.ts @@ -6031,6 +6031,11 @@ declare namespace firebase.firestore { * 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, but + * note that each usage of `FieldValue.serverTimestamp()`, + * `FieldValue.arrayUnion()`, `FieldValue.arrayRemove()`, or + * `FieldValue.increment()` inside a transaction counts as an additional write. + * * @param updateFunction * The function to execute within the transaction context. * @@ -6047,7 +6052,10 @@ declare namespace firebase.firestore { /** * Creates a write batch, used for performing multiple writes as a single - * atomic operation. + * atomic operation. The maximum number of writes allowed in a single WriteBatch + * is 500, but note that each usage of `FieldValue.serverTimestamp()`, + * `FieldValue.arrayUnion()`, `FieldValue.arrayRemove()`, or + * `FieldValue.increment()` inside a WriteBatch counts as an additional write. * * @return * A `WriteBatch` that can be used to atomically execute multiple writes. diff --git a/packages/firestore-types/index.d.ts b/packages/firestore-types/index.d.ts index d5a1c4e714c..78d967b58e5 100644 --- a/packages/firestore-types/index.d.ts +++ b/packages/firestore-types/index.d.ts @@ -193,8 +193,14 @@ export class FirebaseFirestore { * transaction has changed, the updateFunction will be retried. If it fails * to commit after 5 attempts, the transaction will fail. * + * The maximum number of writes allowed in a single transaction is 500, but + * note that each usage of `FieldValue.serverTimestamp()`, + * `FieldValue.arrayUnion()`, `FieldValue.arrayRemove()`, or + * `FieldValue.increment()` inside a transaction counts as an additional write. + * * @param updateFunction The function to execute within the transaction * context. + * * @return If the transaction completed successfully or was explicitly * aborted (by the updateFunction returning a failed Promise), the Promise * returned by the updateFunction will be returned here. Else if the @@ -206,8 +212,14 @@ export class FirebaseFirestore { ): Promise; /** - * Creates a write batch, used for performing multiple writes as a single - * atomic operation. + * Creates a write batch, used for performing multiple writes as a single + * atomic operation. The maximum number of writes allowed in a single WriteBatch + * is 500, but note that each usage of `FieldValue.serverTimestamp()`, + * `FieldValue.arrayUnion()`, `FieldValue.arrayRemove()`, or + * `FieldValue.increment()` inside a WriteBatch counts as an additional write. + * + * @return + * A `WriteBatch` that can be used to atomically execute multiple writes. */ batch(): WriteBatch;