title: DynamoDB Table Count using Nodejs
body: <p>I need to get count of records in my DynamoDB table using Node.js?</p>
  <p>Simply, How to write Node.js snippet for same?</p>
  <pre><code>aws dynamodb scan --table-name dev-xxx-table --select &quot;COUNT&quot;
  </code></pre>
  <p>Tried <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property" rel="nofollow noreferrer">https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property</a></p>
  <pre><code>const params = {
      TableName: Table(),
      Select: COUNT
    }
  
    try {
      const count = await dynamoDb.query(params).promise()
  </code></pre>
  <p>but got</p>
  <blockquote>
  <p>&quot;ReferenceError: COUNT is not defined&quot;,</p>
  </blockquote>
  <p>I couldn't find anything in the documentation for the same(or finding aggregation for DynamoDB table). Any lead will be appreciated.</p>