dynobase-icon
Dynobase

Question: How do you handle empty strings in DynamoDB?

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Answer

Store an empty string directly in a non-key DynamoDB attribute; no service setting is required. Empty String and Binary values are allowed outside key attributes, including inside maps and lists.

A JavaScript v3 document-client item can contain nickname: "". By default, that value remains a String. Setting marshallOptions.convertEmptyValues: true converts supported empty values to NULL instead, so use that option only if null is the representation your application intends.

These cases are different:

  • "" is a present String with zero length.
  • null is a present NULL attribute.
  • An omitted attribute is absent.
  • An empty set is invalid, while an empty list or map is valid.

Table and index key values cannot be empty strings or empty binary values. For a sparse GSI, omit an index-key attribute when the item should not be indexed; do not write an empty string as a substitute.

Check the stored type when migrating old code that used automatic empty-value conversion. Changing the client configuration can change filters and conditions even if the application still displays the field as blank. See data types and NULL behavior.

Source: AWS empty-value support.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Changelog
/
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.