dynobase-icon
Dynobase

Question: Can you store objects as DynamoDB items?

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Answer

Yes. A plain object can become a DynamoDB item, and its nested objects can be stored as Map attributes. With the JavaScript v3 document client, you pass normal JavaScript values rather than manually building DynamoDB type descriptors.

import { DynamoDBClient } from "@aws-sdk/client-dynamodb"; import { DynamoDBDocumentClient, PutCommand } from "@aws-sdk/lib-dynamodb"; const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({})); await ddb.send(new PutCommand({ TableName: "Users", Item: { pk: "USER#123", profile: { city: "Seattle", active: true } }, }));

The table in this example needs a String partition key named pk. If your table also has a sort key, include it. The top-level object's properties become attributes; profile becomes a Map.

Use plain data objects rather than assuming arbitrary class instances, dates or functions can be persisted automatically. Convert dates to a deliberate string or numeric representation. Decide how your application handles undefined; it is different from an explicit null.

The whole item, including keys and nested objects, must fit within 400 KB. Serializing a larger object into a string does not bypass the limit. See Node.js examples and nested objects.

Source: AWS JavaScript guide.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.