【发布时间】:2021-07-08 12:43:13
【问题描述】:
我在嵌套集合上创建 Firestore 文档,因此要创建文档需要在文档上放置一些数据。我正在放置不同的数据,但在设备和模拟器中出现了其他不变的数据。为什么会这样?文档对此有何评论以及应该如何删除它?
代码:
//userPlace is the firestore doc path.
userPlace.set({ "Hi" to "Hello" }).addOnSuccessListener {
userPlace.collection("what").document("what").set("docData")
}
此代码生成的数据在 userPlace 文档路径中显示为 arity : 0。
【问题讨论】:
-
userPlace是否仍定义为val userPath = db.collection("Users").document(who) .collection("UsersActivity").document("history").set(docData)? -
路径无关紧要。即使
db.collection("Users").document("history").set({ "Hi" to "Hello" }),我也得到了相同的结果。
标签: firebase kotlin google-cloud-firestore