diff --git a/src/query.ts b/src/query.ts index 9f2cc4a..438990b 100644 --- a/src/query.ts +++ b/src/query.ts @@ -22,6 +22,7 @@ export type QueryInput< > & ExpressionAttributeNames & ExpressionAttributeNames & + ExpressionAttributeNames & ExpressionAttributeValues & ExpressionAttributeValues & { KeyConditionExpression?: KeyConditionExpression; diff --git a/test/v2-document.test.ts b/test/v2-document.test.ts index cbd399d..abe704e 100644 --- a/test/v2-document.test.ts +++ b/test/v2-document.test.ts @@ -40,6 +40,24 @@ export async function foo(userId: string) { }) .promise(); + // using only projection + await table + .query({ + TableName: "TableName", + AttributesToGet: ["attr"], + KeyConditionExpression: "key = :val", + FilterExpression: "key2 = :val2", + ProjectionExpression: "#key1", + ExpressionAttributeNames: { + "#key1": "", + }, + ExpressionAttributeValues: { + ":val": "val", + ":val2": true, + }, + }) + .promise(); + if (response.Items) { response.Items[0].attr; }