2021-12-01

DynamoDB: Update just the key of a map entry

How can I programmatically change just the key of a nested map in DynamoDB without also changing the value of that map?

For example, see the game table I created below. I want to change the name "Sam" to "Steve" without having to add a new key/value pair to the map. In the GUI I can just change the name and click save, but I can't find an example of how to do this programmatically.

Is it possible to just change the key? Or do I need to create a new key "Steve", copy the contents of "Sam" to "Steve", and then delete the "Sam" key? enter image description here

EDIT: note that I don't want to overwrite the whole scores map, as I don't want to accidentally overwrite other changes that are being made to this record concurrently.



from Recent Questions - Stack Overflow https://ift.tt/3rm02qn
https://ift.tt/3o4er8t

No comments:

Post a Comment