0

I have an Entity named RouteCompletion that identifies Route as it's Parent (using Objectify @Parent annotation).

In the AppEngine Admin Console I am able to query for the specific child by writing a standard key query.

SELECT * FROM RouteCompletion where __key__ = Key('Route',5704906207920128,'RouteCompletion','gc-136985405')

returns the expected result:

  • name=gc-136985405
  • agxzfnRuLWFwaS1kZXZyGgsSCEFjdGl2aXR5IgxnYy0xMzY5ODU0MDUM
  • Activity: name=gc-136985405

I would like to find all children for that same Parent. I tried:

SELECT * FROM RouteCompletion where __key__ = Key('Route',5704906207920128)

The query is valid GQL, but returns no results.

Aaron Roller
  • 1,074
  • 1
  • 14
  • 19

2 Answers2

4

Use has ancestor instead of =.

SELECT * FROM RouteCompletion where __key__ has ancestor Key(Route,5704906207920128)
Pang
  • 9,564
  • 146
  • 81
  • 122
Razvan
  • 347
  • 2
  • 12
0
SELECT * FROM RouteCompletion where ANCESTOR is Key('Route',5704906207920128)
Pang
  • 9,564
  • 146
  • 81
  • 122
Aaron Roller
  • 1,074
  • 1
  • 14
  • 19
  • 1
    doesn't work. I get: GQL query error: Encountered "ancestor" at line 1, column 34. Was expecting one of: "false", "null", "true", , , , , , , , – bgenchel Jul 08 '16 at 00:40