Question

I'd like to reduce the number of queries to delete entities in Google App Engine. I already know how to delete them with ancestor as below sequences.

  1. Set an ancestor to query and fetch them.
  2. Convert entities to keys and delete them using keys.

I'd like to remove first step. My expectation is deleting all entities by ancestor without fetching as below.

DELETE FROM DS1 WHERE ancestor is "PARENT"

Is it possible?

Was it helpful?

Solution

There's no way to delete entities like that. You will need to access them by Key and batch delete.

Though there's a query type that better suits your needs, that is keys-only query, as you appear to be querying for full entities to delete them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top