问题描述
我试图使用Googles开发者控制台查询过滤器,通过一个键在Google云数据存储中查询实体用户。 (Google云开发者控制台 - >云数据存储 - >查询)
I'm trying to query for an entity User in a Google cloud datastore with a key, using Googles developers console query filter. (Google Cloud Developer Console -> Cloud Datastore -> Query)
我无法破译示例语法,并且总是提示以下错误消息:
I fail to decipher the example syntax and am always prompted with the following error message:
错误:数据存储操作的密钥必须采用格式键('kind0','name0'/ id0,'kind1','name1'/ id1,...) code>
Error: Keys for datastore operations must be in the format Key('kind0', 'name0'/id0, 'kind1', 'name1'/id1, ...)
在appengine.google.com上,我曾经像这样在用户上查询特定键:
On appengine.google.com I used to query for a specific key on a User like this:
SELECT * FROM User WHERE __key__ = Key('User','XXXXX')
我在Google开发者控制台中尝试了 Key('User','XXXXX')
,但始终指向上面的错误消息。任何想法是什么正确的语法会是什么?
I tried Key('User','XXXXX')
in the Google developers console but was always pointed to the error message above. Any ideas what the correct syntax would be?
预先感谢!
Thanks in advance!
推荐答案
解析器似乎过于严格。作为一种解决方法,您可以在Key()的参数之间添加空格:
The parser seems to be overly strict. As a workaround, you can add a space between the arguments to Key():
SELECT * FROM User WHERE __key__ = Key('User', 'XXXXX')
这篇关于Google Cloud Datastore - 在开发者控制台中按键过滤的正确语法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!