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: Query Global Secondary Index in Nodejs
- DynamoDB: Query Ends With
- DynamoDB: Query JSON
- DynamoDB: Batch Get
- DynamoDB: Query Count
- DynamoDB: BatchGetItem
- DynamoDB: Get Last 10 Records
- DynamoDB Get in Typescript
- DynamoDB: Increment Counter
- DynamoDB: Get All Items
- DynamoDB: Create if Not Exists
- DynamoDB: Attribute Not Null
- DynamoDB: Get Last Inserted Item
- DynamoDB: Delete Table
- DynamoDB: Query Group By
Login to the AWS Console less. Use Dynobase.
Try 7-day free trial. No strings attached.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase