【问题标题】:How to create Datastore Composite Indexes with just Cloud Functions?如何仅使用 Cloud Functions 创建数据存储复合索引?
【发布时间】:2017-08-19 20:22:30
【问题描述】:

我正在尝试仅使用 Cloud Functions 与 Datastore 交互是否可行。

有没有办法只使用 Cloud Functions 创建复合索引(如 index.yaml)?所以只有 Cloud Functions 代码,没有 App Engine 代码。

谢谢!

【问题讨论】:

    标签: google-cloud-datastore google-cloud-platform google-cloud-functions


    【解决方案1】:

    您只能通过命令行工具 (gcloud datastore create-indexes)创建复合索引定义。这是一项管理功能,不应成为您应用程序的常规部分。您可以使用 Cloud Console 中的浏览器内“Cloud Shell”一次性执行此步骤。

    创建后,由您的 Cloud Functions 代码编写的任何 Cloud Datastore 实体都将添加到复合索引中。

    【讨论】:

    • 谢谢丹!我仍在争论是否将 Cloud Functions 或 App Engine 用于我的 API。是否有任何与 Datastore 相关的 Cloud Functions 无法做到而 App Engine 可以做到的事情?提前致谢! :)
    猜你喜欢
    • 1970-01-01
    • 2016-11-03
    • 2021-04-18
    • 2017-09-25
    • 2017-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多