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 ({
- // ...
- setNewValue: (params, propName, value) =>
- documentClient
- .update({
- ...params,
- UpdateExpression: `set #value = :newValue`,
- ExpressionAttributeValues: {
- ':newValue': value
- },
- ExpressionAttributeNames: {
- '#value': propName
- }
- })
- .promise()
- })
- }
- // ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement