Updating data
Written by
Updated at January 30, 2024
To update the data in the series
table:
AWS CLI
Run the command by replacing https://your-database-endpoint
with the previously prepared Document API endpoint of your DB:
Warning
To work with the AWS CLI from Windows, we recommend using the WSL
endpoint="https://your-database-endpoint"
aws dynamodb update-item \
--table-name series \
--key '{"series_id": {"N": "2"}, "title": {"S": "Silicon Valley"}}' \
--update-expression "SET series_info = :newval" \
--expression-attribute-values '{":newval":{"S":"Silicon Valley is an American comedy television series created by Mike Judge, John Altschuler and Dave Krinsky. The series focuses on five young men who founded a startup company in Silicon Valley."}}' \
--return-values ALL_NEW \
--endpoint $endpoint
Result:
{
"Attributes": {
"series_id": {
"N": ".2e1"
},
"title": {
"S": "Silicon Valley"
},
"release_date": {
"S": "2014-04-06"
},
"series_info": {
"S": "Silicon Valley is an American comedy television series created by Mike Judge, John Altschuler and Dave Krinsky. The series focuses on five young men who founded a startup company in Silicon Valley."
}
}
}