【发布时间】:2020-11-16 09:12:57
【问题描述】:
我在将 Kotlin 数据类对象写入云 Firestore 上的文档时遇到了问题。在我假设这是某种错误之前,我想问一下这是否是预期的行为。
我有一个类似的数据类
data class Notification(
val createdAt: Timestamp?,
val isDismissed: Boolean?,
val text: String?
)
我直接将它添加到 Firestore,例如:
docRef?.add(notification)
但是写入 Firestore 控制台的文档是这样的:
createdAt: month number, 2020 at time AM/PM UTC+8
dismissed: false
text: "My text."
在写入 Firestore 时,是什么导致布尔值从 isDismissed 变为 dismissed?
【问题讨论】:
标签: firebase kotlin google-cloud-firestore boolean