【发布时间】:2019-07-27 17:57:13
【问题描述】:
我有这样的对象:
data class Task(var id: Int? = null,
var cabinId: Int = 0,
var startTime: DateTime,
var endTime: DateTime? = null
)
当我写文件时,它完全没问题:
db.collection("games").document(game.idForTitle)
.set(game)
.addOnSuccessListener { documentReference ->
Log.d(TAG, "DocumentSnapshot written with ID: ${documentReference}")
}
.addOnFailureListener { e ->
Log.w(TAG, "Error adding document", e)
}
但是当我尝试更新它抛出的 endTime 字段时:
java.lang.IllegalArgumentException:无效数据。不支持的类型:org.joda.time.DateTime(在字段 endTime 中找到)
有趣的是 startTime 字段被写为 map,而 endTime 是 null 类型。
有人知道该怎么做吗?
【问题讨论】:
标签: android kotlin google-cloud-firestore