📌  相关文章
📜  firestore 更新数组 - Javascript 代码示例

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

代码示例1
let washingtonRef = db.collection('cities').doc('DC');

// Atomically add a new region to the "regions" array field.
let arrUnion = washingtonRef.update({
  regions: admin.firestore.FieldValue.arrayUnion('greater_virginia')
});
// Atomically remove a region from the "regions" array field.
let arrRm = washingtonRef.update({
  regions: admin.firestore.FieldValue.arrayRemove('east_coast')
});