-
Notifications
You must be signed in to change notification settings - Fork 996
Closed
Labels
Description
[REQUIRED] Describe your environment
- Operating System version: all
- Browser version: _____
- Firebase SDK version: 5.7.1
- Firebase Product: firestore
[REQUIRED] Describe the problem
Similar to
firebase.firestore.FieldValue.arrayUnion(value)
firebase.firestore.FieldValue.arrayRemove(value)
would be great if we have option appendValue(n)
where use it only for numbers fields and (n) should be number even positive or negative value.
this will enable us to minimize the number of transactions for counters problem. and even help us to do counter operations on offline mode..
Code Example
var doc = { a:5, b:10};
var n = -1; //any number
var changeCounter = {a : firebase.firestore.FieldValue.appendValue(n)};
firestore.collection('col').document('doc').update(changeCounter);
newDocResult = {a:4, b:10};
Thanks for amazing firestore
Reactions are currently unavailable