Skip to content

Commit 3145e8d

Browse files
committed
docs(firestore, increment): add warning about possible lost writes
1 parent 26abb06 commit 3145e8d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/firestore/lib/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,11 @@ export namespace FirebaseFirestoreTypes {
720720
* });
721721
* ```
722722
*
723+
* Please be careful using this operator. If writes happen to the field *on the backend / out of your control* to this field
724+
* in rapid succession - multiple writes in a second or two, *some increments will be lost*.
725+
* This may be avoided by using the special increment field in a transaction.
726+
* See https://github.com/invertase/react-native-firebase/discussions/5914
727+
*
723728
* @param n The value to increment by.
724729
*/
725730
static increment(n: number): FieldValue;

0 commit comments

Comments
 (0)