From fb607a1ec6b8d6a5f8cd8f0112892fd43ec466e1 Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Tue, 30 Apr 2019 14:10:36 -0700 Subject: [PATCH 1/2] update documentation --- .../com/google/firebase/firestore/FirebaseFirestore.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java index bedac1352fd..0e8c6d4be42 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java @@ -263,6 +263,10 @@ public Query collectionGroup(@NonNull String collectionId) { * transaction. If any document read within the 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. * @param executor The executor to run the transaction callback on. * @return The task returned from the updateFunction. @@ -306,6 +310,10 @@ public Task runTransaction( /** * Creates a write batch, used for performing multiple writes as a single atomic operation. * + *

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. + * * @return The created WriteBatch object. */ @NonNull From ae38a188b098977a1dc385f9059f86398ab7217b Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Tue, 30 Apr 2019 15:31:21 -0700 Subject: [PATCH 2/2] add batch comment --- .../google/firebase/firestore/FirebaseFirestore.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java index 0e8c6d4be42..a0bb668a0ec 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java @@ -263,9 +263,9 @@ public Query collectionGroup(@NonNull String collectionId) { * transaction. If any document read within the 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. + *

The maximum number of writes allowed in a single transaction batch 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. * @param executor The executor to run the transaction callback on. @@ -310,9 +310,9 @@ public Task runTransaction( /** * Creates a write batch, used for performing multiple writes as a single atomic operation. * - *

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. + *

The maximum number of writes allowed in a single transaction batch 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. * * @return The created WriteBatch object. */