GQL error from Cloud Datastore Viewer for string encoded key

I am trying to get an entity from a Google DataStore using the admin console. I am using SELECT * FROM User where __key__ = KEY('ag9wYWdhbGd1eS1zdGF0aWNyHAsSBUNhY2hlIhEvYnV0dG9ucy9lZGl0LmdpZgw') . According to GQL docs it should work

KEY ("coded key")

OR

KEY ('kind', 'name' / ID [, 'kind', 'name' / ID ...])

but i get

 GQL query error ... Encountered "\'ag9wYWdhbGd1eS1zdGF0aWNyHAsSBUNhY2hlIhEvYnV0dG9ucy9lZGl0LmdpZgw\'" at line 1, column 40. Was expecting one of: <UNQUOTED_NAME> ... <QUOTED_NAME> ... 

But the query SELECT * FROM User where __key__ = KEY(User, 5126463837700096) works fine.

How can I get an object using string encoding?

+4
source share
1 answer

Cloud Datastore GQL does not support getting KEY from a string encoded key.

+2
source

All Articles