Skip to content

Query

Source: src/AWS/DynamoDB/Query.ts

Runtime binding for dynamodb:Query.

Bind this operation to a Table inside a function runtime to get a callable that queries items by key condition, automatically injecting the table name. Provide the QueryHttp layer on the Function to satisfy the binding.

const query = yield* AWS.DynamoDB.Query(table);
const response = yield* query({
KeyConditionExpression: "pk = :pk",
ExpressionAttributeValues: { ":pk": { S: "user#123" } },
});
const items = response.Items;