title: get min and max value from dynamoDb using node.js sdk
body: <p>i used amazon dynamoDb for storing my data. i created database like this</p>
  <blockquote>
  <p>Partition key : userid    ,    Type : String</p>
  <p>Sort key    : score   , Type : Number</p>
  </blockquote>
  <p>and i inserted some rows.</p>
  <blockquote>
  <p>manaf1      | 100</p>
  <p>manaf2      | 500</p>
  <p>manaf1      | 200</p>
  <p>manaf1      | 600</p>
  </blockquote>
  <p>i need to get max &amp; min score for selected user. This is my code</p>
  <pre><code>var AWS = require(&quot;aws-sdk&quot;);
  
  AWS.config.update({
      region: &quot;myRegion&quot;
  });
  
  var docClient = new AWS.DynamoDB.DocumentClient();
  
  var params = {
      &quot;TableName&quot;: &quot;tableName&quot;,
      &quot;KeyConditionExpression&quot;: &quot;#userid = :userid &quot;,
      &quot;ExpressionAttributeNames&quot;: {
          &quot;#userid&quot;: &quot;userid&quot;
      },
      &quot;ExpressionAttributeValues&quot;: {
          &quot;:userid&quot;: {
              &quot;S&quot;: &quot;manaf1&quot;
          }
      }
  };
  
  docClient.query(params, function (err, data) {
      if (err) {
          console.error(&quot;Unable to query. Error:&quot;, JSON.stringify(err, null, 2));
      } else {
          console.log(&quot;Query succeeded.&quot;);
      }
  });
  </code></pre>
  <p>But i got error when running this code.</p>
  <pre><code>Unable to query. Error: {
    &quot;message&quot;: &quot;One or more parameter values were invalid: Condition parameter type does not match schema type&quot;,
    &quot;code&quot;: &quot;ValidationException&quot;,
    &quot;time&quot;: &quot;2016-08-31T06:12:13.825Z&quot;,
    &quot;requestId&quot;: &quot;S1DFFJNDNVV4KQNSO5AEDASFMVJF66Q9ASHDFUAAJG&quot;,
    &quot;statusCode&quot;: 400,
    &quot;retryable&quot;: false,
    &quot;retryDelay&quot;: 0
  }
  </code></pre>
  <p>i need output like</p>
  <blockquote>
  <p>manaf1  minimum score = 100</p>
  <p>manaf1  maximum score = 600</p>
  </blockquote>
  <ol>
  <li>is it possible to get max or min of a number field from dynamoDb?</li>
  <li>what is the issue related with this code?</li>
  </ol>