Cloud Firestore合并true不工作在nodejs中
在firestore文档中,它说合并:true
如果要合并数据,它在这里不起作用
是我的代码,它与示例非常相似,它总是替换旧存储的值使用新的,
async function updateTotal() {
const update = await db.collection("resources").doc(id).update({ "total": "500"}, { merge: true })
}
如果您有解决方案,我真的需要它
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如此其他答案:
这就是 nick-wnick 在他的评论。
这是另一个答案更好地解释了每个选项的用例:
,您应该使用 ,如下:
另请参见:
As shown on this other answer:
This is what nick-w-nick explains in his comment.
This another answer explains better the use case for each option:
For the expected result you explained in your comment, you should be using an increment operation, as follows:
See also: