@aws-sdk/util-dynamodb

aws
esm
@aws-sdk/util-dynamodb JS library on GitHub @aws-sdk/util-dynamodb JS library on npm Download @aws-sdk/util-dynamodb JS library

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-dynamodb/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-dynamodb) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-dynamodb.svg)](https://www.npmjs.com/package/@aws-sdk/util

Version 3.848.0 License Apache-2.0
@aws-sdk/util-dynamodb has no homepage
@aws-sdk/util-dynamodb JS library on GitHub
@aws-sdk/util-dynamodb JS library on npm
Download @aws-sdk/util-dynamodb JS library
INSTALL
Type:
Version:
<script type="module"> import awsSdkutilDynamodb from 'https://cdn.jsdelivr.net/npm/@aws-sdk/util-dynamodb@3.848.0/+esm' </script>
Learn more

@aws-sdk/util-dynamodb

NPM version NPM downloads

This package provides utilities to be used with @aws-sdk/client-dynamodb

If you are looking for DynamoDB Document client, please check @aws-sdk/lib-dynamodb which automatically performs the necessary marshalling and unmarshalling.

Convert JavaScript object into DynamoDB Record

const { DynamoDB } = require("@aws-sdk/client-dynamodb");
const { marshall } = require("@aws-sdk/util-dynamodb");

const client = new DynamoDB(clientParams);
const params = {
  TableName: "Table",
  Item: marshall({
    HashKey: "hashKey",
    NumAttribute: 1,
    BoolAttribute: true,
    ListAttribute: [1, "two", false],
    MapAttribute: { foo: "bar" },
    NullAttribute: null,
  }),
};

await client.putItem(params);

Convert DynamoDB Record into JavaScript object

const { DynamoDB } = require("@aws-sdk/client-dynamodb");
const { marshall, unmarshall } = require("@aws-sdk/util-dynamodb");

const client = new DynamoDB(clientParams);
const params = {
  TableName: "Table",
  Key: marshall({
    HashKey: "hashKey",
  }),
};

const { Item } = await client.getItem(params);
unmarshall(Item);