dynobase-icon
Dynobase

DynamoDB: Get Multiple Items (Guide w/ Code Examples)

To retrieve multiple items from a DynamoDB table using the JavaScript SDK, you can use the batchGet method. This method allows you to specify the keys of the items you want to retrieve and the name of the table you want to retrieve them from.

const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB.DocumentClient(); const keys = [ { id: 'item1' }, { id: 'item2' }, { id: 'item3' } ]; const params = { RequestItems: { 'my-table': { Keys: keys } } }; dynamoDb.batchGet(params, (error, data) => { if (error) { console.log(error); } else { console.log(data); } });

Tired of switching accounts and regions? Use Dynobase.

Try 7-day free trial. No credit card needed.

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2023 Dynobase
+
Login to the AWS Console less.
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.