title: Condition parameter type does not match schema type
body: <p>I have a table in dynamoDB called 'Contributors'. I have a primary composite key where the hash key is 'UserId' and the sort key is 'NoteId'. I want to query for all the items belonging to a particular hashkey.</p>
  
  <p>Now if I use aws-cli, following command works:</p>
  
  <pre><code>aws dynamodb query \
  --table-name Contributors \
  --key-condition-expression 'UserId = :UserId' \
  --expression-attribute-values '{
      ":UserId": {"N":"2"}
  }'
  </code></pre>
  
  <p>But when I write the query in Node.js, neither of the below 2 param objects work:</p>
  
  <pre><code>var params = {
      TableName: "Contributors",
      KeyConditionExpression: "#UserId = :UserId",
      ExpressionAttributeNames: {
          "#UserId": "UserId"
      },
      ExpressionAttributeValues: {
          ":UserId": { "N": "2" }
      }
  };
  </code></pre>
  
  <p>OR this:</p>
  
  <pre><code>var params = {
      TableName: "Contributors",
      KeyConditionExpression: "#UserId = :UserId",
      ExpressionAttributeNames: {
          "#UserId": "UserId"
      },
      ExpressionAttributeValues: {
          ":UserId": "2"
      }
  };
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>ValidationException: One or more parameter values were invalid:
    Condition parameter type does not match schema type</p>
  </blockquote>
  
  <p>What should be the correct param object?</p>