DynamoDB QueryRequest不返回所有结果


val queryReq: com.amazonaws.services.dynamodbv2.model.QueryRequest = new com.amazonaws.services.dynamodbv2.model.QueryRequest(tableName)
.withIndexName(...)
.addKeyConditionsEntry(..., new com.amazonaws.services.dynamodbv2.model.Condition()
.withAttributeValueList(Seq(new com.amazonaws.services.dynamodbv2.model.AttributeValue(...)):_*)
.withComparisonOperator(...))
.addKeyConditionsEntry(..., new com.amazonaws.services.dynamodbv2.model.Condition()
.withAttributeValueList(Seq(new com.amazonaws.services.dynamodbv2.model.AttributeValue().withN(...)):_*)
.withComparisonOperator(...))
.withScanIndexForward(scanDirection)
.withLimit(5000000)

这个查询的withLimit = 5000000,但是只返回了大约3000个结果。dynamodb在每个查询中返回的数据量是否有限制?如果是这样,是否有一个干净的方法来克服这个限制?

我刚刚找到了解决方案。所以我要回答我自己的问题:我可以创建一个while循环,当getLastEvaluatedKey()不为空也不为空时,追加到结果集。

最新更新