Raphael Rafatpanah
Raphael Rafatpanah

Reputation: 19967

AWS CLI - How to filter returned DynamoDB items?

The following command returns all items in a DynamoDB table.

aws dynamodb scan --table-name TABLENAME

How can I filter the items returns? For example, my DynamoDB table has a property called type. How can I filter the returned items such that the returned items are type = somestring?

Upvotes: 1

Views: 1209

Answers (1)

Mark B
Mark B

Reputation: 200476

You've tagged this with both Python and the AWS CLI tool. With the CLI tool you would add a Filter Expression using the --filter-expression command line option, as documented here.

With Python, it depends on which version of the AWS SDK you are using, either Boto or Boto3. I'm not going to dig into each of those, but you simply need to look up how to set a Filter Expression on a DynamoDB scan operation in your SDK of choice.

Upvotes: 2

Related Questions