Showing posts with label dynamodb. Show all posts
Showing posts with label dynamodb. Show all posts

Wednesday, January 20, 2016

Windows command line aws dynamodb update-item example

Here is an example of using update-item on an AWS dynamoDB

aws --region us-east-1 dynamodb update-item ^
--table-name my-dynamo-table-name --key ^
"{""Id"":{""S"":""IdToMatch""}}" ^
--update-expression "SET #H = :h" ^
--expression-attribute-names "{""#H"":""ColumnName""}" ^
--expression-attribute-values "{"":h"":{""S"":""TestString""}}"

This was inspirational:
http://docs.aws.amazon.com/cli/latest/reference//dynamodb/update-item.html

Windows command line aws dynamodb get-item example

It was a pain in the butt figuring out how to do dynamodb get-item using the Windows command line version of aws.

Here is what ended up working for me:

aws --region us-east-1 dynamodb get-item --table-name my-dynamo-table-name --key "{""Id"":{""S"":""IdToMatch""}}"

In my case the table just had a Hash key only and the name of the key is "Id" and the value of Id for the row I wanted was "IdToMatch"

See this for what _MAY_ explain how to use keys of types that are not "S":
http://docs.aws.amazon.com/cli/latest/reference/dynamodb/get-item.html