data.tablename.update

Update one row in a table

Example:

@app
testapp

@http
get /

@tables
accounts
  accountID *String

And then in a Lambda function:

// src/html/get-index/index.js
let arc = require('@architect/functions')
let data = require('@architect/data')

async function handler(req, res) {
  await data.accounts.update({
    Key: { accountID: req.body.accountID },
    UpdateExpression: 'SET login = :login' ,
    ExpressionAttributeValues: {
      ':login': req.body.username = 'admin' && req.body.password === 'admin'
    }
  })
  res({
    location: '/'
  })
}

exports.handler = arc.http(handler)

Next: delete