dynobase-icon
Dynobase

Error: DynamoDB Expression Not Null

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

To test whether a DynamoDB attribute has a non-null value, distinguish an absent attribute from one stored with type NULL. attribute_exists alone also matches attributes whose value is NULL.

const condition = {
  ConditionExpression: "attribute_exists(#value) AND NOT attribute_type(#value, :nullType)",
  ExpressionAttributeNames: { "#value": "optionalValue" },
  ExpressionAttributeValues: { ":nullType": "NULL" },
};

These are native values for a document-client request. With the low-level client, the type-name placeholder is { S: "NULL" }. Use FilterExpression instead of ConditionExpression when filtering query or scan results, and combine it with the operation's required key parameters.

If the actual error says an expression parameter must not be null, inspect that parameter itself: an omitted or empty expression string differs from a NULL item attribute. Every :placeholder must be defined. There is no if_exists expression function. Use attribute_exists or attribute_not_exists for tests; if_not_exists belongs in SET updates and defaults only missing attributes, not existing NULL values.

See filter syntax and AWS documentation.

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.