簡體   English   中英

Google Cloud Datastore 中的復合索引

[英]Composite Index in Google Cloud Datastore

我有一個好聽的名字'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 Datastore does not have the composite index (developer-supplied) required for this query.

.yaml 文件中定義的索引是否不正確? 還是我在這里做錯了什么?

您的索引定義包含ancestor: yes的,這意味着您的查詢應該包含祖先過濾器。 您可以將祖先過濾器添加到查詢中,也可以將索引定義更改為ancestor: no

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM