【发布时间】:2019-07-04 16:07:02
【问题描述】:
我有一个这样的文档集合:
shiftId: {
open: boolean,
terminalId: string,
startDate: Date
}
我的代码查询如下所示:
shiftCollection
.whereEqualTo("open", true)
.whereEqualTo("terminal", "1")
.orderBy("startDate", Query.Direction.DESCENDING)
.limit(1)
.get()
.addOnSuccessListener {
if (it.isEmpty){
Log.d(TAG, "There is no open shift")
return@addOnSuccessListener
}
.......
}
然而查询总是返回空
提前致谢。
【问题讨论】:
-
请附上你整个数据库结构的截图,并注明
shiftCollection是如何初始化的?
标签: kotlin google-cloud-firestore