dynobase-icon
Dynobase

Error: DynamoDB scan filter not working

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

A Scan filter evaluates items after they are read. Unexpected results usually come from a wrong attribute path or value type, missing pagination, or misunderstood Limit behavior. A Scan does not automatically use an index because a filtered attribute is indexed.

import boto3
from boto3.dynamodb.conditions import Attr

table = boto3.resource("dynamodb", region_name="us-east-1").Table("Orders")
params = {"FilterExpression": Attr("status").eq("OPEN")}
while True:
    page = table.scan(**params)
    for item in page.get("Items", []):
        print(item)
    cursor = page.get("LastEvaluatedKey")
    if not cursor:
        break
    params["ExclusiveStartKey"] = cursor

This resource example uses native Python values. With a low-level client, bind typed AttributeValue objects instead. Match case-sensitive attribute names and distinguish String values from Numbers, missing fields, and NULL.

Limit controls the number of items evaluated before filtering. A page can contain zero matches and still require another request. Compare Count with ScannedCount to see selectivity. To reduce reads through an index, explicitly Query that index using its key condition; adding a filter to Scan does not change its access strategy.

See Scan versus Query and AWS documentation.

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.