Google cloud platform Google云数据存储中的复合索引
我有一个名字叫“Wdr”。我的index.yaml文件如下所示Google cloud platform Google云数据存储中的复合索引,google-cloud-platform,google-cloud-datastore,gql,gqlquery,composite-index,Google Cloud Platform,Google Cloud Datastore,Gql,Gqlquery,Composite Index,我有一个名字叫“Wdr”。我的index.yaml文件如下所示 indexes: -kind: Wdr ancestor: yes properties: -name : wdr_id -name : wdr_sub_id direction: desc 我无法运行下面的gql查询 SELECT * FROM Wdr where wdr_id = '1098' order by wdr_sub_id desc 我得到的是 GQL Query error: Your Datas
indexes:
-kind: Wdr
ancestor: yes
properties:
-name : wdr_id
-name : wdr_sub_id
direction: desc
我无法运行下面的gql查询
SELECT * FROM Wdr where wdr_id = '1098' order by wdr_sub_id desc
我得到的是
GQL Query error: Your Datastore does not have the composite index (developer-supplied) required for this query.
.yaml文件中定义的索引是否不正确?还是我在这里做错了什么?您的索引定义包含祖先:是的,这意味着您的查询应该包含祖先筛选器。您可以将祖先过滤器添加到查询中,或者将索引定义更改为
祖先:no
'SELECT*fromWdr
其中key有祖先键(Tan,'f347e5bd-8204-4ff1-b7a5-ae2b65a7ac38')按焊工顺序_sub id asc'此查询也不起作用'SELECT*fromWdr
其中key有祖先键(Tan,'f347efbd-8204-4ff1-b7a5-aecb65a7ac38')按wd_开始时间asc排序“我应该为此查询添加哪些索引?尝试使用该查询的错误消息应该给出所需的索引。我希望它是种类:Wdr祖先:是属性:-名称:Wdr_sub_id/wd_开始时间方向:asc