如何删除CloudFirestore中的复合索引?
文档说:https :
//firebase.google.com/docs/firestore/query-data/indexing
要删除索引:
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.
在当前的 Cloud Firestore 上,
- 可以使用右侧子菜单删除单个字段索引
- 但是悬停不起作用,复合索引部分不存在子菜单
我只找到了一个控制台命令来删除所有为 firestore 数据库编制的索引
回答
我在 Firestore UI Web 面板上遇到了同样的问题,但我找到了一个使用云的解决方案。
首先,您需要输入https://console.cloud.google.com/并在打开 gcloud 终端后选择您的项目(您可以在头像附近的右上角访问它)。
打开终端类型后
gcloud firestore indexes composite list
列出所选项目的所有复合索引
然后选择要删除的 ID 并键入
gcloud firestore indexes composite delete <composite-id>
它会要求您确认,一旦您通过键入并输入y您的索引来完成它就消失了c:
回答
在 Cloud Firestore UI Web 面板中,由于某种原因,带有 3 个垂直点的图标被隐藏了。如果您将鼠标悬停在该行的右侧部分,就在状态字段的右侧,将显示 3 个垂直点图标,将鼠标悬停在该图标上将显示删除集合的复合索引的选项。