title: DynamoDB Scan with FilterExpression in nodejs
body: <p>I'm trying to retrieve all items from a DynamoDB table that match a <code>FilterExpression</code>, and although all of the items are scanned and half do match, the expected items aren't returned.</p>
  
  <p>I have the following in an AWS Lambda function running on Node.js 6.10:</p>
  
  <pre><code>var AWS = require("aws-sdk"),
      documentClient = new AWS.DynamoDB.DocumentClient();
  function fetchQuotes(category) {
      let params = {
          "TableName": "quotient-quotes",
          "FilterExpression": "category = :cat",
          "ExpressionAttributeValues": {":cat": {"S": category}}
      };
      console.log(`params=${JSON.stringify(params)}`);
      documentClient.scan(params, function(err, data) {
          if (err) {
              console.error(JSON.stringify(err));
          } else {
              console.log(JSON.stringify(data));
          }
      });
  }
  </code></pre>
  
  <p>There are 10 items in the table, one of which is:</p>
  
  <pre><code>{
    "category": "ChuckNorris",
    "quote": "Chuck Norris does not sleep. He waits.",
    "uuid": "844a0af7-71e9-41b0-9ca7-d090bb71fdb8"
  }
  </code></pre>
  
  <p>When testing with category "ChuckNorris", the log shows:</p>
  
  <pre><code>params={"TableName":"quotient-quotes","FilterExpression":"category = :cat","ExpressionAttributeValues":{":cat":{"S":"ChuckNorris"}}}
  {"Items":[],"Count":0,"ScannedCount":10}
  </code></pre>
  
  <p>The <code>scan</code> call returns all 10 items when I only specify <code>TableName</code>:</p>
  
  <pre><code>params={"TableName":"quotient-quotes"}
  {"Items":[&lt;snip&gt;,{"category":"ChuckNorris","uuid":"844a0af7-71e9-41b0-9ca7-d090bb71fdb8","CamelCase":"thevalue","quote":"Chuck Norris does not sleep. He waits."},&lt;snip&gt;],"Count":10,"ScannedCount":10}
  </code></pre>