Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
960 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...