zrhl
zrhl

Reputation: 117

Flutter - Update values of maps and arrays in Cloud firestore

I have my Cloud Firestore database as follows

enter image description here

Here Education is a map and Skills is array. I have couple more arrays and maps. How can I edit these values with flutter.

I was guessing maybe like

return Firestore.instance.collection('data/users/$uid')
        .document('user_data')
        .updateData({
      "Education[High school]" : _highSchool,
    });
  }

Upvotes: 1

Views: 1301

Answers (1)

Hakkı Akut
Hakkı Akut

Reputation: 631

didn't test it but maybe this will work

return Firestore.instance.collection('data/users/$uid')
        .document('user_data')
        .setData({
      "Education.High school" : _highSchool,
    });
  }

also there is similar question like that check it out Update the Map field - Flutter

Upvotes: 3

Related Questions