简体   繁体   English

AWS CLI-如何过滤返回的DynamoDB项目?

[英]AWS CLI - How to filter returned DynamoDB items?

The following command returns all items in a DynamoDB table. 以下命令返回DynamoDB表中的所有项目。

aws dynamodb scan --table-name TABLENAME

How can I filter the items returns? 如何过滤退货? For example, my DynamoDB table has a property called type . 例如,我的DynamoDB表具有一个名为type的属性。 How can I filter the returned items such that the returned items are type = somestring ? 如何过滤返回的项目,使返回的项目为type = somestring

You've tagged this with both Python and the AWS CLI tool. 您已使用Python和AWS CLI工具对此进行了标记。 With the CLI tool you would add a Filter Expression using the --filter-expression command line option, as documented here . 使用CLI工具,您可以使用--filter-expression命令行选项添加一个Filter Expression,如此处所述

With Python, it depends on which version of the AWS SDK you are using, either Boto or Boto3. 使用Python,取决于您使用的是哪个版本的AWS开发工具包(Boto或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. 我不会深入探讨这些内容,但是您只需要查看如何在所选SDK中的DynamoDB扫描操作上设置过滤器表达式即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM