I see from their documentation you can batch_get_item for single items
http://boto3.readthedocs.io/en/latest/reference/services/dynamodb.html#DynamoDB.Client.batch_get_item
but I'm not quite sure how to get items from tables with hash range keys. Particularly batch getting items with just the hash value, is this possible?
you can follow this code:
dynamodb = boto3.resource('dynamodb')
r = dynamodb.batch_get_item(RequestItems={
'TABLE_NAME': {
'Keys': [
{
'myPrimaryKey': "123",
'mySortKey': "65894"
},
{
'myPrimaryKey': "123",
'mySortKey': "65004"
},
{
'myPrimaryKey': "123",
'mySortKey': "69654"
}
],
},
})
print(r["Responses"]["TABLE_NAME"])
print(r["UnprocessedKeys"])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With