Build DynamoDB query and scan expressions with key, filter, and projection settings.
Last verified: May 2026
Build DynamoDB query and scan expressions with key, filter, and projection settings.
Required Fields
tableNameoperationkeyConditionExpressionfilterExpressionprojectionExpressionOutput will appear here...The DynamoDB Query Builder helps you construct DynamoDB query and scan expressions with proper key conditions, filter expressions, projection expressions, and expression attribute names and values. DynamoDB's expression syntax with placeholders can be confusing, especially when dealing with reserved words or nested attributes. This tool provides a guided interface that generates the complete expression parameters ready for use with the AWS SDK, CLI, or PartiQL.
A Query reads items from a table or index using the partition key (required) and optional sort key conditions, making it efficient and fast. A Scan reads every item in the table and optionally filters the results, consuming much more read capacity. Always prefer Query over Scan when possible.
Expression attribute names (prefixed with #) are required when attribute names are DynamoDB reserved words or contain special characters. Expression attribute values (prefixed with :) are placeholders for the actual values in conditions, preventing injection and ensuring proper type handling.
Yes. The query expressions generated by this tool work with both the base table and any Global or Local Secondary Indexes. Just specify the index name when executing the query in the SDK or CLI.
Your team needs to find all orders for customer 'cust-123' in the last 30 days. The naive query is `Scan` with a filter — costing thousands of RCUs daily. The builder helps you construct a proper Query: PartitionKey = 'cust-123' AND begins_with(SortKey, '2026-04'). RCUs drop from ~3,000 to 4 per query. The tool also generates the IAM policy showing the minimum action set (dynamodb:Query) on the specific table ARN, so you can scope the application's permissions correctly.
The builder collects query parameters via a form (table name, partition key + value, optional sort key condition with operator like = / BETWEEN / begins_with, optional filter expression, projection attributes) and assembles them into a complete QueryInput or ScanInput object. It generates ExpressionAttributeNames automatically for any reserved words in your attributes, and outputs the result in three formats: AWS CLI command, AWS SDK JavaScript code, and PartiQL SELECT statement.
Filter expressions don't reduce read capacity consumption — they're applied AFTER DynamoDB reads matching items. A query that scans 10,000 items via partition key and filters down to 10 still consumes RCU for all 10,000. Move filter logic into key conditions or design GSIs that pre-filter data instead.
Reserved words in DynamoDB are extensive (size, status, type, name, count, etc.). Always use ExpressionAttributeNames placeholders (#name = :val) by default rather than discovering at runtime which of your attribute names happens to be reserved. The tool generates placeholders consistently — copy that pattern into your application code.
BatchGetItem can fetch up to 100 items per call across multiple tables, while individual GetItem calls each consume their own request overhead. For workloads doing 5+ point reads in sequence, BatchGetItem can cut latency by 50%+ and slightly reduce per-request costs.
Was this tool helpful?
Disclaimer: This tool runs entirely in your browser. No data is sent to our servers. Always verify outputs before using them in production. AWS, Azure, and GCP are trademarks of their respective owners.