我有一个 dynamo 表,分区键为“shop”,排序键为“item”。我想使用 GetItemCommand 使用此复合键查找特定项目。
`const params = {
TableName: process.env.DYNAMODB_TABLE_NAME,
Key: marshall({shop: String(event.pathParameters.shop),
item: String(event.pathParameters.item) }),
};
const {Item} = await db.send(new GetItemCommand(params));
console.log("item" + Item);`
但它返回 undefined