user1607512
user1607512

Reputation: 11

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

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.

Upvotes: 0

Views: 2118

Answers (2)

Gilberto Torrezan
Gilberto Torrezan

Reputation: 5267

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.

Upvotes: 0

Peter Knego
Peter Knego

Reputation: 80340

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)

Upvotes: 1

Related Questions