我来自以下问题。
如何在 Firebase 中管理添加和更新数据 https://stackoverflow.com/questions/61910157/how-to-manage-add-and-update-data-in-firebase/61920349#61920349
最初我可以按照代码在 firestore 中创建数据。
不过我想补充一点car2
代替cars
after car1
。
我不知道。
_firestore.collection('members').document(${loginUser.uid}).setData({
'cars': {
'car1': {
'name': name,
'img_url': 'https://www.xxx.xxx/xxx.png',
'details': {
'type': carType,
}
}
}
请给我建议。
To add cars2
,然后执行以下操作:
_firestore.collection('members').document(${loginUser.uid}).updateData({
"cars.car2": {
'name': name,
'img_url': 'https://www.xxx.xxx/xxx.png',
'details': {
'type': carType,
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)