boto3 dynamodb scan code example
Example 1: dynamodb get all items boto3
import boto3
dynamodb = boto3.resource('dynamodb', region_name=region)
table = dynamodb.Table('my-table')
response = table.scan(FilterExpression=Attr('country').eq('US') & Attr('city').eq('NYC'))
data = response['Items']
while 'LastEvaluatedKey' in response:
response = table.scan(ExclusiveStartKey=response['LastEvaluatedKey'])
data.extend(response['Items'])
.npm__react-simple-code-editor__textarea:empty {
-webkit-text-fill-color: inherit !important;
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.npm__react-simple-code-editor__textarea {
color: transparent !important;
}
.npm__react-simple-code-editor__textarea::selection {
background-color: #accef7 !important;
color: transparent !important;
}
}
Example 2: dynamodb s3 link
var context = new DynamoDBContext();
Book myBook = new Book
{
Id = 501,
CoverImage = S3Link.Create(context, "myBucketName", "covers/AWSSDK.jpg", Amazon.RegionEndpoint.USWest2),
Title = "AWS SDK for .NET Object Persistence Model Handling Arbitrary Data",
ISBN = 999,
BookAuthors = new List { "Jim", "Steve", "Pavel", "Norm", "Milind" }
};
context.Save(myBook);
myBook.CoverImage.UploadFrom("path/to/covers/AWSSDK.jpg");
string coverURL = myBook.CoverImage.GetPreSignedURL(DateTime.Now.AddHours(5));
myBook = context.Load(501);
myBook.CoverImage.DownloadTo("path/to/save/cover/otherbook.jpg");