Firestore index error

后端 未结 5 2120
挽巷
挽巷 2020-12-17 22:53

I am facing some problem when use angular 2 to query data from Firestore.

Could anyone please help me by checking it and tell me where I have done wrong ?

My

5条回答
  •  情话喂你
    2020-12-17 23:23

    If you are using Firebase hosting you can add the following to your firestore.indexes.json file:

    {
      "collectionGroup": "temp",
      "queryScope": "COLLECTION",
      "fields": [
        {
          "fieldPath": "uid",
          "order": "ASCENDING"
        },
        {
          "fieldPath": "startedAt",
          "order": "DESCENDING"
        }
      ]
    }
    

    When you deploy Firebase it will automatically build these indexes.

    You can alternatively deploy the indexes by themselves with this command:

    firebase deploy --only firestore:indexes

提交回复
热议问题