DynamoDB: Query Count (Guide w/ Code Examples)

Provided by Rafal Wilinski
To query the count of items in a DynamoDB table using the JavaScript SDK, you can use the query operation and set the Select parameter to COUNT.
var params = { TableName: "myTable", Select: "COUNT" }; dynamodb.query(params, function(err, data) { if (err) { console.log("Error", err); } else { console.log("Success", data.Count); } });
Similar Code Examples
- DynamoDB: Increment Counter
- DynamoDB: Batch Get
- DynamoDB: Delete All Items With Partition Key
- DynamoDB: Attribute Not Null
- DynamoDB: Bulk Insert
- DynamoDB: Get Multiple Items
- DynamoDB: Query Ends With
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Not Begins With
- DynamoDB: Delete Multiple Items in Javascript
- DynamoDB: Delete Table
- DynamoDB: Query Date Range
- DynamoDB: Get Unique Values
- DynamoDB Get in Typescript
- DynamoDB: Query Group By
Spend less time in the AWS console, use Dynobase.
Try 7-day free trial. No strings attached.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase