doc.update

db.collection('todos').doc('todo-identifiant-aleatoire').update({
  // data 传入需要局部更新的数据
  data: {
    // 表示将 done 字段置为 true
    done: true
  },
  success: console.log,
  fail: console.error
})

唯一标示>=id (记住)
doc(这里加的是id)
'todo-identifiant-aleatoire'  反正就是id,文档中这是啥意思我也不知道,可能是在这个集合中的唯一标识,经验正就是id
posted @ 2018-09-14 16:09  ThisCall  阅读(988)  评论(0编辑  收藏  举报