【发布时间】:2018-09-29 11:05:07
【问题描述】:
当我在 Xcode 中使用这段代码时:
let washingtonRef = db.collection("cities").document("DC")
// Atomically add a new region to the "regions" array field.
washingtonRef.updateData([
"regions": FieldValue.arrayUnion(["greater_virginia"])
])
// Atomically remove a region from the "regions" array field.
washingtonRef.updateData([
"regions": FieldValue.arrayRemove(["east_coast"])
])
这是Firebase Website 中的一个示例,我收到以下错误:
Type 'FieldValue' has no member 'arrayUnion'
这个问题有什么解决办法吗?
【问题讨论】:
标签: swift firebase google-cloud-firestore