arvindwill
arvindwill

Reputation: 1992

Appengine datastore edit entity's Identifier

Initially while creating datastore had used auto-generated identifier for every entity. But currently planning to assign manually identifier to the Entity.

1)Is there way to edit the identifier through Appengine Datastore Viewer ?

2)Is it possible to change the identifier for each entity programatically?

Upvotes: 0

Views: 52

Answers (1)

Andrei Volgin
Andrei Volgin

Reputation: 41099

You cannot edit entity id through a Datastore viewer.

You can programmatically read each entity and save it as a new entity with a new ID, then delete the old entity. There is no "cheaper" way of doing it.

Note that assigning IDs manually may lead to congestion (this is the reason App Engine now assigns non-sequential IDs) and race condition (two or more instances trying to save an entity with the same id at the same time).

Upvotes: 1

Related Questions