DynamoDB Get in Typescript (Guide w/ Code Examples)
Provided by Rafal Wilinski
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: GetItem
- DynamoDB: Get Unique Values
- DynamoDB: Query Ends With
- DynamoDB: Increment Counter
- DynamoDB: Query Count
- DynamoDB: Not Begins With
- DynamoDB: Get Last Inserted Item
- DynamoDB: Get Random Item
- DynamoDB: Query Group By
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Batch Get
- DynamoDB: Get Multiple Items
- DynamoDB: Query Global Secondary Index in Nodejs
- DynamoDB: Delete All Items With Partition Key
- DynamoDB: Bulk Insert
Login to the AWS Console less. Use Dynobase.
First 7 days are on us. No strings attached.
Product Features
DynamoDB Tools
DynamoDB Info
© 2024 Dynobase