title: How to fetch/scan all items from `AWS dynamodb` using node.js
body: <p>How to fetch/scan all items from <code>AWS dynamodb</code> using <code>node.js</code>. I am posting my code here.</p>
  
  <pre><code>var docClient = new aws.DynamoDB.DocumentClient();
      var params = {
      TableName:"users",
      KeyConditionExpression:"user_status=:status",
      ExpressionAttributeValues: {
          ":status": "Y"
      }
      };
  
      var queryExecute = function(callback) {
          docClient.query(params,function(err,result) {
              if(err) {
                  console.log(err)
                  callback(err);
                  } else {
                  console.log(result);
  
                  if(result.LastEvaluatedKey) {
                      params.ExclusiveStartKey = result.LastEvaluatedKey;
                      queryExecute(callback);
                      } else {
                          callback(err,items);
                      }
                  }
              });
          }
          queryExecute(callback); 
  </code></pre>
  
  <p>This is giving me below error.</p>
  
  <pre><code>ValidationException: Query condition missed key schema element: `user_id`.
  </code></pre>
  
  <p>Here primary key is user_id. I don't want to use it with my query condition, because I need to set a value if I mentioned primary key in <code>KeyConditionExpression</code>. May be I am wrong. However please suggest me a good way to fetch all items from <code>dynamodb</code>, which is having <code>user_status = "Y"</code></p>