I'm looking to query for Datastore Entities by parent key (i.e., to return entities with keys that are 1 path segment under the parent key). I know that I can use a HAS_ANCESTOR query to get the parent and all descendants, but I only want the immediate children.
I was hoping a __parent__ property would be available for this purpose, but this does not seem to work:
{propertyFilter: {
property: {name: '__parent__'},
op: 'EQUAL',
value: {keyValue: {
partitionId: {projectId: 'myproject'},
path: [{kind: 'row', name: 'parent'}]
}}
}
I know I can also record a depth property in each entity to achieve this, but would rather not do that if Datastore supports a query like this natively using the key itself.