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: BatchGetItem
- DynamoDB: Query Greater Than
- DynamoDB: Attribute Not Null
- DynamoDB: Query Ends With
- DynamoDB: Query KeyConditionExpression
- DynamoDB Get in Typescript
- DynamoDB: Get Random Item
- DynamoDB: Batch Get
- DynamoDB: Create if Not Exists
- DynamoDB: Query Group By
- DynamoDB: Delete
- DynamoDB: Get Last Inserted Item
- DynamoDB: Get Table
- DynamoDB: Not Between
- DynamoDB: Delete Multiple Items in Javascript
Tired of AWS Console? Try Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2024 Dynobase