How to query one field then order by another one in Firebase cloud Firestore?

前端 未结 6 987
粉色の甜心
粉色の甜心 2021-02-13 04:14

I\'m struggling to make a (not so) complex query in firebase cloud firestore.

I simply need to get all docs where the id field ==

6条回答
  •  梦毁少年i
    2021-02-13 04:32

    As per firestore document,

    If you attempt a compound query with a range clause that doesn't map to an existing index, you receive an error. The error message includes a direct link to create the missing index in the Firebase console.

    So just click that link you get in Logcat, it will be redirected to create index page, just create index. It will take some time. after enabling composite index, you will get the result as your requested query.

提交回复
热议问题