Dynamo DB - 批量获取项目分页

Dynamo DB - batch-get-item pagination

我正在尝试从 CLI 运行 batch-get-item 并收到一个错误,我不能传递超过 100 个键:

failed to satisfy constraint: Member must have length less than or equal to 100

这是我使用的命令

aws dynamodb batch-get-item \
--request-items file://request-items.json \
--return-consumed-capacity TOTAL > user_table_output.txt

我想知道是否有办法为我的查询添加分页? 还是有其他方法可以 运行 查询? 我有大约 4000 个键需要查询。

提前致谢。

您必须将密钥分成不超过 100 个的批次。另外,请记住,如果返回的项目大小超过 16MB,响应可能不会包括您请求的所有项目。如果发生这种情况,响应将包含 UnprocessedKeys,可用于请求未检索到的密钥。

BatchGetItem has information about the API, or you can view the CLI doc here.