Adding items

  1. Use the aws dynamodb put-item CLI command to add an item to the DynamoDB table:
aws dynamodb put-item 
--table-name my_table
--item '{"id":{"S":"001"}, "datetime":{"N":"1536898265"}, "field1":{"N":"20"}}'
--region us-east-1
--profile admin
  1. Add a data item with different sets of attributes:
aws dynamodb put-item 
--table-name my_table
--item '{"id":{"S":"001"},"datetime":{"N":"1536898285"}, "field1":{"N":"30"}, "field2":{"S":"ABC"}}'
--region us-east-1
--profile admin

We added an additional attribute, field2.

  1. Add an item with an existing field, but different data type:
aws dynamodb put-item 
--table-name my_table
--item '{"id":{"S":"002"},"datetime":{"N":"1536898295"}, "field1":{"S":"DEF"}}'
--region us-east-1
--profile admin
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.76.72