How to delete composite indexes in Cloud Firestore?

Viewed 2487

The documentation says : https://firebase.google.com/docs/firestore/query-data/indexing

To delete an index:

Go to the Cloud Firestore section of the Firebase console.
Click the Indexes tab.
Hover over the index you want to delete and select Delete from the context menu.
Confirm that you want to delete it by clicking Delete from the alert.

On current Cloud Firestore ,

  • Single field index can be deleted by using right submenu
  • But hovering doest work and submenu are inexistent for composite index section

I have only found a console command to delete all indexed for a firestore db

2 Answers

I have same issue with firestore UI web panel tho I found a solution using cloud.

First you need to enter https://console.cloud.google.com/ and select your project after that open gcloud terminal (you can access this on the top right corner nearby your avatar).

enter image description here

To list all your composite indexes for selected project, type this into the terminal

gcloud firestore indexes composite list

Then pick id of the one you want to remove and type

gcloud firestore indexes composite delete <composite-id>

It'll ask you for confirmation, once you done it by typing and entering y your index is gone c:

In the Cloud Firestore UI web panel, the icon with 3 vertical dots is for some reason hidden. If you hover over the right part of the line, just right to the status field, the 3 vertical dots icon will show and hovering over that will show an option to delete the composite index for a collection.

Related