I need to get count of records in my DynamoDB table using Node.js?
Simply, How to write Node.js snippet for same?
aws dynamodb scan --table-name dev-xxx-table --select "COUNT"
Tried https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property
const params = {
TableName: Table(),
Select: COUNT
}
try {
const count = await dynamoDb.query(params).promise()
but got
"ReferenceError: COUNT is not defined",
I couldn't find anything in the documentation for the same(or finding aggregation for DynamoDB table). Any lead will be appreciated.
scan. So what exactly is the issue?