mag*_*n94 9 dart flutter google-cloud-firestore
我有一个包含数组字段的文档。
如何更新阵列?
在 firebase 函数中,使用打字稿,我做了这样的事情:
admin.firestore()
.collection('friendships')
.doc(caller.data["uid"])
.update({
friends: admin.firestore.FieldValue
.arrayUnion({
friendDisplayName: snapshot.data["friendDisplayName"],
friendUid: snapshot.ref
})
})
Run Code Online (Sandbox Code Playgroud)
我找不到 Flutter 的任何替代方案.. 我该怎么办?
像这样的东西
firestore.instance.
.collection('friendships')
.document(caller.data["uid"])
.updateData({
friends: FieldValue.arrayUnion({
friendDisplayName: snapshot.data["friendDisplayName"],
friendUid: snapshot.ref
})
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8785 次 |
| 最近记录: |