I'm studying the Google Cloud Datastore GQL grammar - specifically the HAS ANCESTOR
and HAS DESCENDANT
comparison operators.
Giving the following Person entities:
- Amy
- Fred, parent = Amy
- Laura, parent = Amy
- Paul
- Agnes ...
Would the GQL queries below produce the same output?
SELECT * FROM Person WHERE key_name='Fred' HAS ANCESTOR KEY('Person', 'Amy')
SELECT * FROM Person WHERE KEY('Person', 'Amy') HAS DESCENDANT key_name='Fred'
If so, I don't understand the existence of HAS DESCENDANT clause.
Thanks in advance!
These two GQL queries should produce identical results: