Amazon Web Services · sdk · fg-0173

DynamoDB DocumentClient put throws Pass options.removeUndefinedValues=true to remove undefined values

If you see Error: Pass options.removeUndefinedValues=true to remove undefined values from map/array/set, the cause and the fix for Amazon Web Services are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Error: Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.Same item shape saved fine with the v2 DocumentClientFails only when an optional field is undefined
Cause
The v3 marshaller refuses undefined values by default instead of dropping them. The option is set when you create the document client, not per call.
Fix
Create the document client with removeUndefinedValues true, or strip undefined fields before the write.
Apply
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb'; const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({}), { marshallOptions: { removeUndefinedValues: true }, });
Affected
@aws-sdk/lib-dynamodb and @aws-sdk/util-dynamodb, all v3 releases
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun