Tip: instead of creating indexes here, run queries in your code – if you're missing any indexes, you'll see errors with links to create them. Learn more
I'm getting an error no matching index found without the usual direct link to create the index required.
My database is structured as follows:
answers (collection)
- $docId (document)
- $refId (collection)
- $docId (document)
- created_at (timestamp)
- type (string)
My query is:
firebase.firestore()
.collection('answers')
.doc('abcdHajM930Gabcd')
.collection('abcdetIo25xYqAabcd')
.orderBy("created_at", "desc")
.limit(5)
.where("type", "==", "3")
I've tried all combinations of indexes I could think of (screenshot below), What am I doing wrong?
| 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 |


