【问题标题】:Delete Firestore indexes programmatically/CLI以编程方式/CLI 删除 Firestore 索引
【发布时间】:2019-01-29 15:17:49
【问题描述】:

可以使用firebase deploy --only firestore:indexes 从 CLI 部署索引。

但是是否可以使用 CLI 或通过某种客户端删除它们?

我在 CLI 文档中看不到对它的任何引用。虽然它似乎有一个 REST 端点here,但我必须编写一个客户端来调用它。

强制用户进入控制台 UI 并为他们想要删除的每个索引手动单击“删除”似乎很笨拙。特别是因为在开发过程中这些指标可能会经常变化。

【问题讨论】:

  • 如果您使用 CLI 部署的索引不包含您要删除的索引,该怎么办?
  • @DougStevenson 它只是给了我警告there are some indexes defined in your project that are not present in your firestore indexes file. Run firebase firestore:indexes and save the result to correct the discrepancy
  • 好的,这听起来像是您应该提交的功能请求。 firebase.google.com/support/contact/bugs-features
  • @DougStevenson 谢谢,完成。

标签: firebase google-cloud-firestore firebase-cli


【解决方案1】:

更新:

现在 CLI 似乎会提示您删除远程存在但未在 firestore.indexes.json 中定义的索引。

以前的答案:

我已提交功能请求,但截至目前(2019 年 1 月 29 日),无法通过 CLI 执行此操作。

引用我收到的回复:

这绝对是一个非常需要的功能,但不知道何时实施。您可以关注Firebase Release Notes,了解 Firebase 的最新消息。

【讨论】:

    猜你喜欢
    • 2011-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-10
    • 2012-01-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多