Skip to content

[firebase_database] transaction do nothing #22

@ektelat

Description

@ektelat

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions