A full scan of DynamoDB in Python is possible by using the LastEvaluatedKey
.
Scanning DynamoDB using LastEvaluatedKey
According to the boto3
scan documentation,
If LastEvaluatedKey is present in the response, you need to paginate the result set. For more information, see Paginating the Results in the Amazon DynamoDB Developer Guide.
Simply check for the LastEvaluatedKey
in the response using response.get('LastEvaluatedKey')
.
|
|
In the example above, the list of items (data
) is extended with each page of items.