【发布时间】:2018-03-20 07:21:44
【问题描述】:
在 JavaScript 中,我写了这样的东西,但它返回错误 >“文档引用必须有偶数个段”。对于我的情况,我需要使用“设置”而不是“添加”。
const ref= db.collection("product");
ref.doc("111").doc("category").set({ clothes: true });
在 Firebase 的实时数据库中,我可以编写这样的代码,但在 Firestore 中我不能。
ref.child("111").child("category").set({ clothes: true });
如何在 Firestore 中编写这样的代码?
谢谢。
【问题讨论】:
标签: javascript firebase firebase-realtime-database google-cloud-firestore