Created
September 30, 2017 20:29
-
-
Save reisjr/9b21f855aa5244d492563776ad080540 to your computer and use it in GitHub Desktop.
DynamoDB - Using Paginator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ddb_client = boto3.client("dynamodb", region_name='eu-west-1') | |
paginator = ddb_client.get_paginator("query") | |
pages = paginator.paginate( | |
TableName=TABLE_NAME, | |
ConsistentRead=False, | |
KeyConditionExpression="Identifier = :k", | |
ExpressionAttributeValues={ | |
":k" : { "S" : key } | |
}, | |
PaginationConfig={'PageSize': 250 }, | |
ReturnConsumedCapacity='TOTAL' | |
) | |
for page in pages: | |
print(page) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment