javascript - 查询 Firebase Firestore 并对其进行排序会导致错误
问题描述
我正在做一个简单的查询以从 firestore 获取我需要的数据。
this.unsubscribe = this.ref
.where('channelId', '==', `${currentChannel.id}`)
.orderBy('createdAt', 'asc')
.onSnapshot(this.onCollectionUpdate);
Ref 只是对我收藏的参考。
当我有或者.where
它.orderBy
工作正常但是当我将它们链接在一起时,这是根据这里看到的文档https://firebase.google.com/docs/firestore/query-data/order-limit-data ?authuser=0你可以这样做,但在我的情况下它会抛出一个错误:
SnapshotError: Firestore: Operation was rejected because the system is not in a state required for the operation's execution
任何帮助都感激不尽。
解决方案
在等待了将近 25 分钟后,它神奇地自行解决了。
对于阅读本文的人,请耐心等待,以防出现此错误并且控制台显示所有内容都已启用。这需要更多的时间。
推荐阅读
- r - 调整分层 R 数据框,以便变量的值在行中匹配(基于组和日期)
- javascript - 如何使用 javascript 更改复杂的 CSS 节点属性?
- r - 在 R 中大写邮政编码
- python - 使用 Pandas groupby 如何使用加法聚合一列列表?
- java - 递归 - 如何获得没有小数的整数
- mongodb - 组数 2 项对象数组 mongodb
- python - 嵌套字典和字符串索引错误
- ubuntu - 如何将由重复“n”次的 ASCII 字符组成的字符串作为命令行参数传递给简单的 c 程序?
- timezone - 无法更改 GitLab 时区
- firebase - Firestore 通过 Firebase Functions 与 Firestore SDK 的性能差异