How to do a batch write, update and delete entities in low-level api datastore?

2.1k views Asked by At

I want to add 100 entities (then update and delete them) to the datastore, but I don't know how to do that in a low level api. I did it in JDO. The documentation for low level is very scarce.

2

There are 2 answers

0
Gilberto Torrezan On

The documentation is here: Batch Operations.

I suggest you to take a look at the async datastore api as well to improve even more the performance of your application.

0
Peter Knego On

You can pass a collection of entities to put method - this will batch create/update the entities: datastoreService.put(Iterable<Entity>) (collection of Entities).

You can also batch delete: datastoreService.delete(Iterable<Key> collection) (collection of Keys) or datastoreService.delete(Key.. keys) (array of Keys)