AWS SDK

DynamoDB

  • dynamoDB is NoSQL so need to for whatever index you use you must include some condition for the index and sorting key in the keyconditionexpression

    • Might need to create a new index or scan

V3

  • Better than V2(aws-sdk) cuz allows selective importing and typescript and async is first class

npm i @aws-sdk/lib-dynamodb @aws-sdk/client-dynamodb

Setup

import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';

ddbClient = DynamoDBDocument.from(
      new DynamoDBClient({
        apiVersion: '2012-08-10',
        region: process.env.AWS_REGION,
      })
    )

Get

Update

Create

Query

Scan

V2

Setup

npm i aws-sdk

Get

Query

Update

Last updated