Skip to content

Commit 4e40319

Browse files
author
Brian Chen
authored
Adding documentation for WriteBatch size limit (#392)
1 parent 9286a98 commit 4e40319

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ public Query collectionGroup(@NonNull String collectionId) {
263263
* transaction. If any document read within the transaction has changed, the updateFunction will
264264
* be retried. If it fails to commit after 5 attempts, the transaction will fail.
265265
*
266+
* <p>The maximum number of writes allowed in a single transaction batch is 500, but note that
267+
* each usage of FieldValue.serverTimestamp(), FieldValue.arrayUnion(), FieldValue.arrayRemove(),
268+
* or FieldValue.increment() inside a transaction counts as an additional write.
269+
*
266270
* @param updateFunction The function to execute within the transaction context.
267271
* @param executor The executor to run the transaction callback on.
268272
* @return The task returned from the updateFunction.
@@ -306,6 +310,10 @@ public <TResult> Task<TResult> runTransaction(
306310
/**
307311
* Creates a write batch, used for performing multiple writes as a single atomic operation.
308312
*
313+
* <p>The maximum number of writes allowed in a single transaction batch is 500, but note that
314+
* each usage of FieldValue.serverTimestamp(), FieldValue.arrayUnion(), FieldValue.arrayRemove(),
315+
* or FieldValue.increment() inside a transaction counts as an additional write.
316+
*
309317
* @return The created WriteBatch object.
310318
*/
311319
@NonNull

0 commit comments

Comments
 (0)