DynamoDB: Query Ends With (Guide w/ Code Examples)

Provided by Rafal Wilinski
To query items where a specific attribute ends with a certain string, you can use the endsWith
condition in the KeyConditionExpression
parameter of the query operation.
Note that, the attributeName
should be the name of the attribute you want to use in the condition, and the value
should be the string you want to match the end of the attribute with.
var params = { TableName: "myTable", KeyConditionExpression: "attributeName endsWith :value", ExpressionAttributeValues: { ":value": "stringToMatch" } }; dynamodb.query(params, function(err, data) { if (err) { console.log(err); } else { console.log(data); } });
Similar Code Examples
- DynamoDB: Create if Not Exists
- DynamoDB: Bulk Insert
- DynamoDB: Get Table
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Delete All Items With Partition Key
- DynamoDB: Get By ID
- DynamoDB: Query JSON
- DynamoDB: BatchGetItem
- DynamoDB: GetItem
- DynamoDB: Delete Table
- DynamoDB: Delete Multiple Items in Javascript
- DynamoDB: Query Count
- DynamoDB: Query Items
- DynamoDB: Query Greater Than
- DynamoDB: Get Last Inserted Item
Tired of AWS Console? Try Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase