1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
You can use the following code to achieve what you need:
import boto3
# get a list of items from dynamodb using pagination, default page size is 25 return all items
def get_items_from_dynamo_db(table_name, page_size=25, dynamodb=None):
if not dynamodb:
dynamodb = boto3.resource("dynamodb")
table = dynamodb.Table(table_name)
response = table.scan(Limit=page_size)
items = response["Items"]
while "LastEvaluatedKey" in response:
response = table.scan(ExclusiveStartKey=response["LastEvaluatedKey"], Limit=page_size)
items.extend(response["Items"])
return items
For your reference, this code was generated by CodeWhisperer using the following 2 lines:
import boto3
# get a list of items from dynamodb using pagination, default page size is 25 return all items
관련 콘텐츠
- AWS 공식업데이트됨 일 년 전