MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / main

Function main

javascriptv3/example_code/dynamodb/actions/scan.js:11–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9const client = new DynamoDBClient({});
10
11export const main = async () => {
12 const command = new ScanCommand({
13 FilterExpression: "CrustType = :crustType",
14 // For more information about data types,
15 // see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes and
16 // https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.LowLevelAPI.html#Programming.LowLevelAPI.DataTypeDescriptors
17 ExpressionAttributeValues: {
18 ":crustType": { S: "Graham Cracker" },
19 },
20 ProjectionExpression: "Flavor, CrustType, Description",
21 TableName: "Pies",
22 });
23
24 const response = await client.send(command);
25 for (const pie of response.Items) {
26 console.log(`${pie.Flavor.S} - ${pie.Description.S}\n`);
27 }
28 return response;
29};
30// snippet-end:[dynamodb.JavaScript.table.scanV3]
31
32// Invoke main function if this file was run directly.

Calls 2

sendMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected