Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ...
- const getModule = (config) => {
- const documentClient = new AWS.DynamoDB.DocumentClient(config)
- return ({
- // ...
- getByPK: (params, attributes = undefined) =>
- documentClient
- .get(
- mergedParams(params, attributes ? projectionExpression(attributes) : {})
- )
- .promise()
- .then(data => (Object.keys(data).length ? data.Item : undefined))
- })
- }
- // ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement