【发布时间】:2021-08-31 15:12:57
【问题描述】:
所以我正在尝试增加数据以将 num 发送到其他用户的 num。
const sendNum = async(e) => {
e.preventDefault();
const targetQuery = query(userCol, where("keycode", "==", parseInt(target)));
const targetSnapshot = await getDocs(targetQuery)
targetSnapshot.forEach((document) => {
console.log(document.data().num)
console.log(document.id)
const targetRef = doc(db, 'users', document.id)
setDoc(targetRef, {
num: // increment user data here
}, {merge: true})
})
}
但是我发现的一个文档,我并不真正理解它们。 而据我所知,它已经过时了。 所以如果有人知道怎么做,我会很高兴:)
【问题讨论】:
标签: javascript firebase google-cloud-firestore