dynobase-icon
Dynobase

DynamoDB: Query Greater Than (Guide w/ Code Examples)

Rafal Wilinski

Provided by Rafal Wilinski

To query a DynamoDB table using the JavaScript SDK and retrieve items where a specific attribute has a value greater than a certain value, you can use the query operation and pass in an object containing the necessary parameters.

const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB.DocumentClient(); const params = { TableName: 'myTable', KeyConditionExpression: '#id > :value', ExpressionAttributeNames: { '#id': 'id', }, ExpressionAttributeValues: { ':value': 5 } }; dynamoDb.query(params, (error, data) => { if (error) { console.log(error); } else { console.log(data.Items); } });

Tired of switching accounts and regions? Use Dynobase.

Try 7-day free trial. No credit card needed.

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
/
Affiliates & Influencers
© 2024 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.