dynobase-icon
Dynobase

Error: dynamodb query is null

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

A DynamoDB Query with no matches returns an empty result set, not a null query object. If you want to find null-valued attributes, test the DynamoDB NULL type. If you want missing attributes, use attribute_not_exists; those are different conditions.

import boto3
from boto3.dynamodb.conditions import Key, Attr

table = boto3.resource("dynamodb", region_name="us-east-1").Table("Orders")
page = table.query(
    KeyConditionExpression=Key("pk").eq("CUSTOMER#123"),
    FilterExpression=Attr("note").attribute_type("NULL"),
)
items = page.get("Items", [])
# For absent attributes instead, use Attr("note").not_exists().

To include either missing or NULL values, combine Attr("note").not_exists() | Attr("note").attribute_type("NULL"). Continue pagination while LastEvaluatedKey is present; a filtered page can be empty before the query is finished.

If your application receives null or undefined rather than a normal response, check that it awaited and returned the SDK call and did not swallow an exception. A missing TableName or an invalid key condition produces a validation error, not the normal empty-result case.

See boto3 Query examples 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.