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

Provided by Rafal Wilinski
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); } });
Similar Code Examples
- DynamoDB: Delete All Items With Partition Key
- DynamoDB: BatchGetItem
- DynamoDB: Query Items
- DynamoDB: Delete Table
- DynamoDB: Query Ends With
- DynamoDB: Get Query
- DynamoDB: Get All Items
- DynamoDB: Query KeyConditionExpression
- DynamoDB: Query Greater Than
- DynamoDB: Delete Multiple Items in Javascript
- DynamoDB: Create if Not Exists
- DynamoDB: Get Table
- DynamoDB: Like
- DynamoDB: Attribute Not Null
- DynamoDB BatchWriteItem in Typescript
Spend less time in the AWS console, use Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase