Query by key and index
Fetch items by partition key, add a sort-key condition with any supported operator, and target global or local secondary indexes without writing an expression.
When to query
A Query reads only the items that share a partition key value, optionally narrowed by a sort-key condition. It is the efficient access pattern DynamoDB was designed for: cost is proportional to what you read, not to the size of the table. Use Query whenever you know the partition key; fall back to Scan when you do not.
Fields
Switch the Filters panel to Query. DynamoOps fills the key names from the table or index schema; you only type values.
- Indexselect
- Primary Key by default, followed by every global secondary index by name and local secondary indexes marked “(LSI)”. Changing the index rewrites the key fields to match its schema.
- Partition Keyvaluerequired
- The attribute name is shown read-only; type the value to match.
- Sort Key conditionselect
- Shown only when the table or index has a sort key. Operators:
=,<,<=,>,>=,begins_withandbetween. Applied only when the value is non-empty. - Value / Value 2value
- Value 2 appears for
betweenand holds the upper bound. - Page Sizenumber
- Items per page, default 50.
Running a query
- Pick the index
Choose Primary Key or the index that has the attribute you want to look up as its partition key.
- Enter the partition key value
This is mandatory. Leaving it empty shows “Partition key value is required for Query”.
- Optionally narrow by sort key
Pick an operator and value. For a date-prefixed sort key,
begins_withwith2026-10returns a month. - Execute
DynamoOps builds the key condition expression for you and runs the query with consumed capacity reporting.
#pk = :pkval AND #sk BETWEEN :skval AND :skval2How values are typed
"001" or "123", the Query form will not match it. Use SQL mode and quote the value instead: WHERE "orderId" = '001'.- Query mode has no filter-expression field; for post-key filtering use PartiQL or Scan.
- Results are returned in the index’s natural sort order. Reverse ordering is available through PartiQL
ORDER BY … DESCwhere supported. - Reads are eventually consistent.
Operator reference
| Operator | Matches sort keys that are… | Example |
|---|---|---|
= | exactly equal | 2026-10-24 |
< | strictly less than | before a date |
<= | less than or equal | up to and including a date |
> | strictly greater than | after a date |
>= | greater than or equal | from a date onwards |
begins_with | starting with the given prefix | ORDER# |
between | inclusive range from Value to Value 2 | 2026-01-01 … 2026-12-31 |