Filip
Filip

Reputation: 2411

How to update single value in map without updating all map in firestore?

it is possible to update single value in map in document in Firestore without updating entire map in Flutter?

Example: I have doc with some map like on screen below. Is it possible to update a single value e.g. I want to change 2 to 'abc' without updating the entire map in Flutter?

enter image description here

Upvotes: 1

Views: 670

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317948

To update a nested map property, use dot notation to give a path to the property to update:

documentReference.update({ "players.1": "value" })

Upvotes: 4

Related Questions