moromi-dynamodb

aws dynamodb plugin for moromi

Usage no npm install needed!

<script type="module">
  import moromiDynamodb from 'https://cdn.skypack.dev/moromi-dynamodb';
</script>

README

moromi-dynamodb

aws dynamodb plugin for moromi

Installation

  yarn add moromi-dynamodb

Usage

params:

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'
    }
  }
}