firebase-tools: v13.16.0
- Add Firebase config to
public/index.htmlin// TODO: Add your firebase config here - Run
firebase emulators:start --project PROJECT_ID - Open http://127.0.0.1:5000
- Generate the query index
- Click
get doc: __name__ ascbutton - Open console logs, and open the link to create the query index
- Click
get doc: __name__ descbutton - Open console logs, and open the link to create the query index
- Wait for index to finish building
- Click
- Run
firebase firestore:indexes --project PROJECT_ID- Outputs
{
"indexes": [
{
"collectionGroup": "random-collection",
"queryScope": "COLLECTION_GROUP",
"fields": [
{
"fieldPath": "a",
"order": "ASCENDING"
},
{
"fieldPath": "b",
"order": "DESCENDING"
}
]
},
{
"collectionGroup": "random-collection",
"queryScope": "COLLECTION_GROUP",
"fields": [
{
"fieldPath": "a",
"order": "ASCENDING"
},
{
"fieldPath": "b",
"order": "DESCENDING"
}
]
}
],
"fieldOverrides": []
}
- Firebase Console Firestore Indexes
Deploying the Firestore indexes results in only 1 of the 2 indexes to be created(the __name__ descending is being created, __name__ ascending is not)
- Delete the current indexes in the Firestore console
- Run
firebase deploy --only firestore --project PROJECT_ID. Current indexes:
{
"indexes": [
{
"collectionGroup": "random-collection",
"queryScope": "COLLECTION_GROUP",
"fields": [
{
"fieldPath": "a",
"order": "ASCENDING"
},
{
"fieldPath": "b",
"order": "DESCENDING"
}
]
},
{
"collectionGroup": "random-collection",
"queryScope": "COLLECTION_GROUP",
"fields": [
{
"fieldPath": "a",
"order": "ASCENDING"
},
{
"fieldPath": "b",
"order": "DESCENDING"
}
]
}
],
"fieldOverrides": []
}
- Firebase Console Firestore indexes shows only 1 index was created

- Open http://127.0.0.1:5000
- Click
get doc: __name__ ascbutton - Open console logs:
- Raises as error because the query index containig the field index
__name__Ascending is missing
- Raises as error because the query index containig the field index
