1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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
Contenus pertinents
- demandé il y a un an
- demandé il y a 9 mois
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 9 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 3 ans