如何在不使用 java 指定主键的情况下从 DynamoDB 表中获取所有项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28104454/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I fetch all items from a DynamoDB table without specifying the primary key with java?
提问by Devicedriver
I'm fairly new to Amazon's AWS and its API for Java, so I'm not exactly sure what the most efficient method for what I'm trying to do would be. Basically, I'm trying to setup a database that will store a project's ID, it's status, as well as the bucket. What I'm having trouble with is getting a list of all user without primary key ?. Any recommendations?
我对亚马逊的 AWS 及其 Java API 相当陌生,所以我不确定我正在尝试做的最有效的方法是什么。基本上,我正在尝试设置一个数据库来存储项目的 ID、状态以及存储桶。我遇到的问题是获取没有主键的所有用户的列表?。有什么建议吗?
回答by RandomQuestion
You can use the 'Scan' operation provided by DynamoDB. It does not need primary key to operate on. But keep in mind that scan operation is very inefficient and needs more read capacity. Read about Scan
here on it's official doc.
您可以使用 DynamoDB 提供的“扫描”操作。它不需要主键来操作。但请记住,扫描操作非常低效并且需要更多读取容量。在Scan
这里阅读它的官方文档。
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html
If you want to just retrieve all the entries, DynamoDB is probably not a acorrect choice for storing this data.
如果您只想检索所有条目,DynamoDB 可能不是存储这些数据的正确选择。