We can read items using get-item, query, or scan:
- Use the aws dynamodb get-item CLI command, passing all key fields:
aws dynamodb get-item \ --table-name my_table \ --key '{"id":{"S":"002"},"datetime":{"N":"1536898295"}}' \ --return-consumed-capacity TOTAL \ --region us-east-1 --profile admin
This command will return a single item, along with metadata describing the result. The result part returned is shown in the following screenshot:
The metadata part is shown in the following screenshot:
I had added the return-consumed-capacity ...