【发布时间】:2021-05-09 03:11:49
【问题描述】:
我正在为我的颤振应用程序使用 Firebase,并且我创建了一个 .IndexOn。
查询与 OrderByChild 一起工作,问题是在加载查询时,它只加载了 Cashe。
例如,当我在设备 1 上打开应用程序时,同时我通过另一个设备 2 创建了一条记录。如果我删除应用程序缓存,设备 1 只会加载新数据。
我正在使用 PersitenceEnabled,但问题只发生在使用 .IndexOn 的查询中
"users": {
".indexOn": ["isPsycho","currentPsycho"]
}
我正在使用的查询
await databaseReference
.orderByChild('isPsycho')
.equalTo(true)
.once()
.then((DataSnapshot snapshot)
【问题讨论】:
-
你能展示你如何加载数据的代码吗?我强烈建议您遵循 how to create a minimal, complete, verifiable example 中的指导,以最大限度地提高我们提供帮助的机会。
-
@FrankvanPuffelen 好的,更新了问题。
标签: android firebase flutter firebase-realtime-database