代码之家  ›  专栏  ›  技术社区  ›  David Faizulaev

Dynamo DB-批处理获取项目分页

  •  0
  • David Faizulaev  · 技术社区  · 5 年前

    我在试着经营一家公司 batch-get-item 从CLI获取一个无法传递超过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把钥匙需要查询。

    1 回复  |  直到 5 年前
        1
  •  2
  •   Jason Wadsworth    5 年前

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

    BatchGetItem CLI doc here .

    推荐文章