Question: Can DynamoDB have null values?

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Answer
Yes. DynamoDB has a native NULL attribute type, and reads return null-valued attributes unless your projection excludes them. A stored null is not the same thing as an attribute that does not exist.
In the low-level API, an explicit null is represented as {"NULL": true}. The JavaScript document client accepts null, and boto3's table interface accepts Python None. Neither requires storing the string "null".
To distinguish the cases in expressions:
attribute_exists(#field)is true when the attribute exists, even if its value is null.attribute_not_exists(#field)checks for a missing attribute.attribute_type(#field, :type)with:typeset to the stringNULLchecks for an explicit null.
Use an expression-name alias for #field and supply the value placeholder in the appropriate client format. A Query filter checks these expressions after reading matching key data, so it does not make null searches into indexed lookups.
Primary-key and index-key attributes must use supported scalar key types, not NULL. To omit an item from a sparse GSI, leave out an index-key attribute instead of setting it to null. See data types and filter expressions.
Source: AWS data types.
Other Common DynamoDB FAQ (with Answers)
- Can you rename a DynamoDB table?
- How do you enable CloudTrail for DynamoDB?
- Can I use a UUID as a DynamoDB partition key?
- How to track changes to items in DynamoDB?
- Is DynamoDB OLTP or OLAP?
- Is DynamoDB based on MongoDB?
- Can DynamoDB have duplicates?
- How do you access DynamoDB from outside AWS?
- Is connection pooling needed for DynamoDB?
- Are DynamoDB table names unique?
- Can colons and special characters be used in DynamoDB attributes?
- How do you handle empty strings in DynamoDB?
- How do you mock DynamoDB in a test?
- How to import data from S3 to DynamoDB?
- Is DynamoDB open source?
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today