我将comment实体存储在 Datastore 中,并Datastore Viewer用于查看存储的数据。
我可以做以下查询
select * from comment
select __key__ from comment
select Subject from comment
select Comment from comment
但我无法查询
select Subject, Comment from comment
// Error: The suggested index for this query is:
// - kind: comment
// properties:
// - name: Comment
// - name: Subject
select __key__, Subject, Comment from comment
// Error: projections are not supported for the property: __key__
我找不到任何参考为什么它是错误的。这些错误并没有告诉我太多。
我没有为这些实体设置任何键或索引。
文档说明如下:
SELECT [DISTINCT] [* | <property list> | __key__]
[FROM <kind>]
[WHERE <condition> [AND <condition> ...]]
[ORDER BY <property> [ASC | DESC] [, <property> [ASC | DESC] ...]]
[LIMIT [<offset>,]<count>]
[OFFSET <offset>]
<property list> := <property> [, <property> ...]
<condition> := <property> {< | <= | > | >= | = | != } <value>
<condition> := <property> IN <list>
<condition> := ANCESTOR IS <entity or key>
<list> := (<value> [, <value> ...]])
Subject, Comment- 是属性列表,它是有效的查询。但事实并非如此。我从 Go 代码创建了实体。
回首忆惘然
相关分类