Skip to content

Instantly share code, notes, and snippets.

@reisjr
Created September 30, 2017 20:29
Show Gist options
  • Save reisjr/9b21f855aa5244d492563776ad080540 to your computer and use it in GitHub Desktop.
Save reisjr/9b21f855aa5244d492563776ad080540 to your computer and use it in GitHub Desktop.
DynamoDB - Using Paginator
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