DynamoDB Get in Typescript (Guide w/ Code Examples)
To get an item from a DynamoDB table using TypeScript, you can use the DocumentClient
class from the aws-sdk
package.
import * as AWS from 'aws-sdk'; const dynamoDb = new AWS.DynamoDB.DocumentClient(); const params = { TableName: 'my-table', Key: { primaryKey: 'some-value', }, }; dynamoDb.get(params, (error, data) => { if (error) { console.error(error); } else { console.log(data.Item); } });
Similar Code Examples
- DynamoDB: Query Greater Than
- DynamoDB: Delete Multiple Items in Javascript
- DynamoDB: Bulk Insert
- DynamoDB: Increment Counter
- DynamoDB: Get All Items
- DynamoDB: Get Last Inserted Item
- DynamoDB: Query Ends With
- DynamoDB: Query KeyConditionExpression
- DynamoDB: Query Items
- DynamoDB: Delete
- DynamoDB: Query Date Range
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Get Table
- DynamoDB: Query Group By
- DynamoDB: Get By ID
Login to the AWS Console less. Use Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2023 Dynobase