Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to return items in a dynamodb on aws-cli

So, I have a DynamoDB table Users and I want to return all the contents of this table. Or maybe even some.

I tried

aws dynamodb query --table-name Users  

and it says I have to specify key-condition or key-condition-expression, so I added the following:

aws dynamodb query --table-name Users --key-condition-expression Username = "test" 

and it returns an error message " Unknown options: test ".

like image 430
Bennjoe Mordeno Avatar asked Jan 08 '16 02:01

Bennjoe Mordeno


People also ask

How do I get items from DynamoDB table?

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.

How get data from DynamoDB to AWS CLI?

To run the dynamodb commands, you need to: AWS CLI installed, see Installing or updating the latest version of the AWS CLI for more information. AWS CLI configured, see Configuration basics for more information. The profile that you use must have permissions that allow the AWS operations performed by the examples.

Does DynamoDB query return all items?

The Query operation in Amazon DynamoDB finds items based on primary key values. You must provide the name of the partition key attribute and a single value for that attribute. Query returns all items with that partition key value.

What is DynamoDB return?

DynamoDB API aws dynamodb get-item returns a set of attributes for the item with the given primary key. If no matching item, then it does not return any data and there will be no Item element in the response.


1 Answers

If you want to dump the whole table, just use

aws dynamodb scan --table-name Users 
like image 65
ataylor Avatar answered Oct 19 '22 09:10

ataylor