Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
892 views
in Technique[技术] by (71.8m points)

google cloud firestore - Firebase index required but no link provided

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.

enter image description here

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.6k users

...