DynamoDB: GetItem (Guide w/ Code Examples)

Provided by Rafal Wilinski
The AWS SDK for JavaScript provides a getItem method for retrieving an item from a DynamoDB table.
const AWS = require('aws-sdk'); const dynamodb = new AWS.DynamoDB({region: 'us-west-2', apiVersion: '2012-08-10'}); const params = { TableName: 'MyTable', Key: { 'PrimaryKey': {S: 'some-value'}, 'SortKey': {N: '123'}, }, }; dynamodb.getItem(params, function(err, data) { if (err) { console.log(err); } else { console.log(data); } });
Similar Code Examples
- DynamoDB: Delete Table
- DynamoDB: Create if Not Exists
- DynamoDB: Get All Items
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Not Begins With
- DynamoDB: Query Items
- DynamoDB: Get Last 10 Records
- DynamoDB: Get Multiple Items
- DynamoDB: Attribute Not Null
- DynamoDB: Get By ID
- DynamoDB: Query JSON
- DynamoDB: Get Unique Values
- DynamoDB: Like
- DynamoDB: Query Global Secondary Index in Nodejs
- DynamoDB: Delete Multiple Items in Javascript
Spend less time in the AWS console, use Dynobase.
Start your 7-day free trial today
Product Features
DynamoDB Tools
DynamoDB Info
© 2026 Dynobase