【发布时间】:2021-07-15 05:03:19
【问题描述】:
提示:不要在此处创建索引,而是在您的代码中运行查询 - 如果您缺少任何索引,您将看到创建它们的链接错误。 Learn more
我收到错误no matching index found,没有创建所需索引的常用直接链接。
我的数据库结构如下:
answers (collection)
- $docId (document)
- $refId (collection)
- $docId (document)
- created_at (timestamp)
- type (string)
我的查询是:
firebase.firestore()
.collection('answers')
.doc('abcdHajM930Gabcd')
.collection('abcdetIo25xYqAabcd')
.orderBy("created_at", "desc")
.limit(5)
.where("type", "==", "3")
我已经尝试了所有我能想到的索引组合(下面的屏幕截图),我做错了什么?
| collection | field | type |
|---|---|---|
| answers | created_at: DESC | type: ARRAY |
| answers | created_at: DESC | type: ARRAY |
| answers | created_at: DESC | type: ASC |
| answers | created_at: DESC | type: ASC |
| answers | type: ASC | created_at: DESC |
| answers | type: ASC | created_at: DESC |
【问题讨论】:
标签: firebase google-cloud-firestore