README
moromi-dynamodb
aws dynamodb plugin for moromi
Installation
yarn add moromi-dynamodb
Usage
params:
- method: the sdk method name (as per AWS SDK for node.js docs)
- params: the sdk method parameters (as per AWS SDK for node.js docs)
Example
To update a numerical attribute called active_time
in an item identified by primary key email
in a table called users
:
{
name: 'update user active_time',
params: {
method: 'putItem',
params: {
ExpressionAttributeNames: { '#AT': 'active_time' },
ExpressionAttributeValues: { ':at': `${new Date().valueOf()}` },
Key: { email: { S: 'tester@example.com' } },
ReturnValues: 'NONE',
TableName: 'users',
UpdateExpression: 'SET #AT = :at'
}
}
}