【发布时间】:2021-01-16 06:52:57
【问题描述】:
我想更新我的文档的状态“状态”,但是执行之后我看不到变化,这是怎么回事?
let batch = firebaseApp.firestore().batch()
schools
.get()
.then(snapshot => {
snapshot.docs.forEach(doc => {
const student = firebaseApp
.firestore()
.collection('students')
.doc(doc.id)
batch.update(student, {
status: 'changed',
})
student.get().then(function(doc) {
console.log("here", doc.data());
})
})
})
在控制台我看到这个:'here' 'suscribed' 应该是 'here' 'changed'
【问题讨论】:
标签: javascript reactjs firebase google-cloud-firestore