【发布时间】:2023-04-05 00:46:02
【问题描述】:
我想在 Firebase 中更新一个文档。问题是只能更新特定字段?
我想做这样的事情:
fs.collection("users").document(user.id).update(user)
问题在于 Kotlin 强制将字段放入更新中,如下所示:
fs.collection("users").document(user.id).update("firstname", user)
但我不希望这样,我想用我的模型而不是字段来更新整个文档。
【问题讨论】:
-
你使用的是什么节点版本?
标签: android firebase kotlin google-cloud-firestore