7

I understand that they are not supposed to be changed, this is somewhat of a schema migration and only a one-time thing.

I would like to change the key names of entities in my Google App Engine application, effectively deleting and re-crating an entity and updating all references to it.

What is the best way to do this? I'm interesting in hearing anyone's experience with such things.

Noah McIlraith
  • 14,122
  • 7
  • 31
  • 35

1 Answers1

5

Since changing the key name is functionally identical to creating a new, identical entity with that key, what you want to do is clone the entity with the new key. Here's some code that does just that.

Community
  • 1
  • 1
Nick Johnson
  • 100,655
  • 16
  • 128
  • 198