For listing all tables in a locally-installed instance of DynamoDB, I know that the command is:
aws dynamodb list-tables --endpoint-url http://localhost:8000
Now, I want to view the contents of one of the tables. What is the command to do that?
To access DynamoDB running locally, use the --endpoint-url parameter. The following is an example of using the AWS CLI to list the tables in DynamoDB on your computer. The AWS CLI can't use the downloadable version of DynamoDB as a default endpoint. Therefore, you must specify --endpoint-url with each AWS CLI command.
To read an item from a DynamoDB table, use the GetItem operation. You must provide the name of the table, along with the primary key of the item you want. The following AWS CLI example shows how to read an item from the ProductCatalog table. With GetItem , you must specify the entire primary key, not just part of it.
With AWS Glue Elastic Views, you can specify a DynamoDB table as a source and materialize views in Amazon Elasticsearch Service, Amazon S3, and Amazon Redshift. AWS Glue Elastic Views is serverless and scales capacity up or down automatically based on demand, so there's no infrastructure to manage.
To update an existing item in an Amazon DynamoDB table, you use the UpdateItem operation. You must provide the key of the item that you want to update. You must also provide an update expression, indicating the attributes that you want to modify and the values that you want to assign to them.
Go to "http://localhost:8000/shell/" and execute the below script. Please change the table name as per your requirement.
When you run the local DynamoDB the above URL should be up and running.
var dynamodb = new AWS.DynamoDB({ region: 'us-east-1', endpoint: "http://localhost:8000" }); var tableName = "TESTTABLE"; var params = { TableName: tableName, Select: "ALL_ATTRIBUTES" }; function doScan(response) { if (response.error) ppJson(response.error); // an error occurred else { ppJson(response.data); // successful response // More data. Keep calling scan. if ('LastEvaluatedKey' in response.data) { response.request.params.ExclusiveStartKey = response.data.LastEvaluatedKey; dynamodb.scan(response.request.params) .on('complete', doScan) .send(); } } } console.log("Starting a Scan of the table"); dynamodb.scan(params) .on('complete', doScan) .send();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With