DynamoDB: Get By ID (Guide w/ Code Examples)

Provided by Rafal Wilinski
To retrieve an item by if from a DynamoDB table using the JavaScript SDK, you can use the getmethod. The method takes an object with the required parameters, including the table name and the primary key of the item you want to retrieve. Here is an example of how you can use the getmethod to retrieve an item with a specific Id:
const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB.DocumentClient(); const params = { TableName: 'my-table', Key: { id: 'some-id' } }; dynamoDb.get(params, (error, data) => { if (error) { console.error(error); return; } console.log(data.Item); });
Similar Code Examples
- DynamoDB: Get Unique Values
- DynamoDB: Bulk Insert
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Get All Items
- DynamoDB: Get Last Inserted Item
- DynamoDB: Increment Counter
- DynamoDB: BatchGetItem
- DynamoDB: Query Group By
- DynamoDB: GetItem
- DynamoDB: Query KeyConditionExpression
- DynamoDB: Query JSON
- DynamoDB: Query Count
- DynamoDB: Batch Get
- DynamoDB: Get Multiple Items
- DynamoDB: Attribute Not Null
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
DynamoDB Info
© 2026 Dynobase