text: var AWS = require("aws-sdk");
  
  var AWSConfig = require("./config/aws_config_remote")();
  
  var docClient = new AWS.DynamoDB.DocumentClient();
  
  var params = {
      TableName: "Movies",
      /**
       * ProjectionExpression specifies the attributes you want in the scan result.
       */
      ProjectionExpression: "#yr, title, info.rating",
  
      /**
       * FilterExpression specifies a condition that returns only items 
       * that satisfy the condition. All other items are discarded.
       */
      FilterExpression: "#yr between :start_yr and :end_yr",
      ExpressionAttributeNames: {
          "#yr": "year",
      },
      ExpressionAttributeValues: {
           ":start_yr": 1950,
           ":end_yr": 1959 
      }
  };
  
  console.log("Scanning Movies table.");
  docClient.scan(params, onScan);
  
  function onScan(err, data) {
      if (err) {
          console.error("Unable to scan the table. Error JSON:", JSON.stringify(err, null, 2));
      } else {
          // print all the movies
          console.log("Scan succeeded.");
          data.Items.forEach(function(movie) {
             console.log(
                  movie.year + ": ",
                  movie.title, "- rating:", movie.info.rating);
          });
  
          // continue scanning if we have more movies, because
          // scan can retrieve a maximum of 1MB of data
          if (typeof data.LastEvaluatedKey != "undefined") {
              console.log("Scanning for more...");
              params.ExclusiveStartKey = data.LastEvaluatedKey;
              docClient.scan(params, onScan);
          }
      }
  }