首页 > 解决方案 > 查询 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

任何帮助都感激不尽。

在此处输入图像描述

标签: javascriptfirebasegoogle-cloud-firestore

解决方案


在等待了将近 25 分钟后,它神奇地自行解决了。

对于阅读本文的人,请耐心等待,以防出现此错误并且控制台显示所有内容都已启用。这需要更多的时间。


推荐阅读