Talked
Talked

Reputation: 173

How to edit a data type (Map) in Firestore from Flutter

I have this information "Tarifas" which is a map and I am trying to edit it in my Flutter application

but i haven't found a correct way to do it:

this is my data in Firestore

enter image description here

and this is the code that I have tried

Firestore.instance
          .collection("parqueaderos")
          .document(widget.idparking)
          .updateData({
            "tarifas['Carros']" : tCarros,
            "tarifas['Motos']" : tMotos,
            "tarifas['Bicicletas']" : tBicicletas,
          });

I'm looking for an idea how to edit it

Upvotes: 0

Views: 288

Answers (1)

ByteMe
ByteMe

Reputation: 1670

Try the following

Firestore.instance
          .collection("parqueaderos")
          .document(widget.idparking)
          .updateData({
            "tarifas.Carros" : tCarros,
            "tarifas.Motos" : tMotos,
            "tarifas.Bicicletas" : tBicicletas,
          });

Upvotes: 2

Related Questions