dynobase-icon
Dynobase

DynamoDB: Get Unique Values (Guide w/ Code Examples)

To retrieve unique values from a DynamoDB table using the JavaScript SDK, you can use the queryor scan operations and set the Distinct parameter to true. This will return only the unique values for the specified attribute.

But the scan operation does not support Distinct parameter, instead, you can use the filterExpression to filter the unique values.

var params = { TableName: "myTable", Distinct: true, KeyConditionExpression: "#product = :product", ExpressionAttributeNames: { "#product": "product" }, ExpressionAttributeValues: { ":product": "myProduct" } }; dynamodb.query(params, function(err, data) { if (err) { console.log(err); } else { console.log(data); } });

Spend less time in the AWS console, use Dynobase.

First 7 days are on us. No strings attached.

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2023 Dynobase
+
Login to the AWS Console less.
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.