oividiosCaeremos
oividiosCaeremos

Reputation: 728

Only Update a Subfield in "Firebase" Flutter

I am trying to update a subfield on firebase but I couldn't figure out how to only update one field at a time.

This is how my Firebase table looks like;

enter image description here

And this is how I'm trying to do it:

enter image description here

And lastly, this is how it looks after the update:

enter image description here

This is seriously taking time and I couldn't find any videos that shows how to update a field only. Everyone just updates the document as a whole. Thanks in advance people.

Upvotes: 0

Views: 241

Answers (1)

burakozyurt
burakozyurt

Reputation: 124

dbRefUser.updateData({"properties.currentCashBalance": currentCashBalance + ourTransaction.amount });

Use this. I think it will work.

Upvotes: 2

Related Questions