【发布时间】:2020-12-05 17:48:06
【问题描述】:
我正在尝试从我的颤振代码中找到一种将元素添加到 firebase 数据库内的映射字段的方法。该元素也是一个地图。所以它是一个嵌套的地图。
Future updateImageDate({
String token,
int rating,
int like,
int display_count,
//Map participants,
}) async {
return await pictureCollection.document(token).updateData({
'rating': rating,
'like': like,
'display_count': display_count,
//'participants': participants,
// I want to add only one element to this existing map field in firebase database.
// Although currently it's empty, I want to keep add new element every time I use this method.
// The element as well is a map. So it's a nested map.
});
}
请帮帮我!我期待着您的回音。先感谢您。 :D
【问题讨论】:
标签: firebase flutter google-cloud-firestore