Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save florianmartens/dbf891064280a8ea45fc66344ef51013 to your computer and use it in GitHub Desktop.
Save florianmartens/dbf891064280a8ea45fc66344ef51013 to your computer and use it in GitHub Desktop.
Lambda Function
export async function main(event, context) {
const params = {
TableName: process.env.tableName,
KeyConditionExpression: "userId = :userId",
ExpressionAttributeValues: {
":userId": event.requestContext.identity.cognitoIdentityId
}
};
try {
const result = await dynamoDbLib.call("query", params);
return success(result.Items);
} catch(e) {
return failure( { status: false });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment