Dynamodb 范围查询给出的结果数量有限

Dynamodb Range query gives limited number of results

我正在尝试使用 google guice 框架和 dynamodb 数据库来实现应用程序。

我已经实现 API 通过范围查询查找文档,即。当我按月查询的时间段它提供有限数量的文档,即 3695 个文档,我再次按开始时间和结束时间搜索它也提供相同数量的文档,但不包含新创建的文档。

请想办法实现API,这将解决应用程序或dynamodb 的限制问题。

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).