📜  从数组 firebase swift 5 中删除和元素 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.044000             🧑  作者: Mango

代码示例1
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"])
])