text: /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  SPDX-License-Identifier: Apache-2.0
  
  ABOUT THIS NODE.JS EXAMPLE: This example works with the AWS SDK for JavaScript (v3),
  which is available at https://github.com/aws/aws-sdk-js-v3. This example is in the 'AWS SDK for JavaScript v3 Developer Guide' at
  https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html.
  
  Purpose:
  ddb_scan.js demonstrates how to return items and attributes from an Amazon DynamoDB table.
  
  Running the code:
  node ddb_scan.js
  */
  // snippet-start:[dynamodb.JavaScript.table.scanV3]
  
  // Import required AWS SDK clients and commands for Node.js
  import { ScanCommand } from "@aws-sdk/client-dynamodb";
  import { ddbClient } from "./libs/ddbClient.js";
  
  // Set the parameters.
  export const params = {
    // Specify which items in the results are returned.
    FilterExpression: "Subtitle = :topic AND Season = :s AND Episode = :e",
    // Define the expression attribute value, which are substitutes for the values you want to compare.
    ExpressionAttributeValues: {
      ":topic": { S: "SubTitle2" },
      ":s": { N: "1" },
      ":e": { N: "2" },
    },
    // Set the projection expression, which the the attributes that you want.
    ProjectionExpression: "Season, Episode, Title, Subtitle",
    TableName: "EPISODES_TABLE",
  };
  
  
  export const run = async () => {
    try {
      const data = await ddbClient.send(new ScanCommand(params));
      return data;
      data.Items.forEach(function (element, index, array) {
        console.log(element.Title.S + " (" + element.Subtitle.S + ")");
      });
    } catch (err) {
      console.log("Error", err);
    }
  }
  run();
  // snippet-end:[dynamodb.JavaScript.table.scanV3]
  // For unit tests only.
  // module.exports ={run, params};
  