Flutter - Update values of maps and arrays in Cloud firestore

Viewed 1051

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,
    });
  }
1 Answers

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

Related