Update data

  • To update data, use the command update-item
  1. Execute the command:
aws dynamodb update-item \
     --table-name Music \
     --key '{ "Artist": {"S": "Acme Band"}, "SongTitle": {"S": "Happy Day"}}' \
     --update-expression "SET AlbumTitle = :newval" \
     --expression-attribute-values '{":newval":{"S":"Updated Album Title"}}' \
     --return-values ALL_NEW
  1. Result:
  • Results on AWS CLoudShell:
{
     "Attributes": {
         "AlbumTitle": {
             "S": "Updated Album Title"
         },
         "Awards": {
             "N": "10"
         },
         "Artist": {
             "S": "Acme Band"
         },
         "SongTitle": {
             "S": "Happy Day"
         }
     }
}
  • Result on the interface:

Update Data CloudShell!