-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
Description
i run transaction to add 1 to the last value, put it return the last value
this my code:
Future saveNewMission(Message message) async {
TransactionResult res = await _firebase
.reference()
.child('offices')
.child(this.officeKey)
.child('counters/missions')
.runTransaction((count) async {
count.value = (count.value ?? 0) + 1;
return count;
});
this.count = res.dataSnapshot.value;
always i get la last value that saved on the database