0

I need to delete bulk records from datastore, I went through all the previous links but all just talked about fetching the entities from datastore and then deleting them one by one , problem in my case is that I have got around 80K entities and read gets timed out whenever i try to do it using datastore db.delete() method .

Does any one here by any chance know a method more close to SQL to perform a bulk delete ?

  • 2
    See the answer [HERE](http://stackoverflow.com/questions/108822/delete-all-data-for-a-kind-in-google-app-engine/). :) – Kjuly Dec 23 '11 at 05:27

3 Answers3

3

You can use Task Queue + DB Cursor for deletion.

Task can be executed up to 10 minutes, it's probably enought time to delete all entities. But if it takes longer, you can get current cursor position, and call task itself one more time, with this cursor as paramtere, and start processing from last position.

Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
0

You can use Cloud Dataflow to bulk delete entities in Datastore. You can use a GQL query to select the entities to delete:

https://cloud.google.com/datastore/docs/bulk-delete

Juan Lara
  • 6,454
  • 1
  • 22
  • 31
0

Define what API you're using. JDO? GAE? JPA? You refer to some db.delete, yet tag this as JDO; they are not the same. JDO obviously provides pm.deletePersistentAll(), and if wanting more than that you can make use of Google Mapper API

DataNucleus
  • 15,497
  • 3
  • 32
  • 37