如何在 Datastore 中为复合索引配置命名空间?

How to configure namespace for composite index in Datastore?

我有一个 kind events 存储在不同的 namespaces 中,这取决于服务阶段(dev/stage/prod).

我只想为 dev 命名空间中的一种添加复合索引,但找不到配置它的方法

我使用命令创建索引:

gcloud datastore indexes create ~/myapp/index.yaml

index.yaml

indexes:

- kind: events
  properties:
  - name: created
    direction: desc
  - name: approved
    direction: desc

你知道只为一个人创建索引的方法吗namespace

复合索引针对每个数据库,因此跨命名空间。无法为每个命名空间配置复合索引。

中还有一些其他详细信息。