我正在尝试使用 google guice 框架和 dynamodb 数据库来实现应用程序。 我已经实现了通过范围查询查找文档的 API,但结果集不更新新记录。记录数始终相同。 我们如何解决这个问题?
最佳答案
dynamodb 的响应限制为每页 1mb。此外,当您的结果集较大时,您只会获得第一个结果,直到响应大小为 1MB。
在文档中: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Pagination
描述了如何使用响应的元数据来查看实际结果量、起始索引等。批量/页查询破洞结果。
文档的重要摘录:
If you query or scan for specific attributes that match values that amount to more than 1 MB of data, you'll need to perform another Query or Scan request for the next 1 MB of data. To do this, take the LastEvaluatedKey value from the previous request, and use that value as the ExclusiveStartKey in the next request. This will let you progressively query or scan for new data in 1 MB increments.
When the entire result set from a Query or Scan has been processed, the LastEvaluatedKey is null. This indicates that the result set is complete (i.e. the operation processed the “last page” of data).
关于java - Dynamodb Range 查询给出有限数量的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29412364/