data.tablename.query

Query a table for a collection of rows

Example:

@app
testapp

@http
get /

@tables
notes
  noteID *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) {
  let noteID = req.query.noteID
  let result = await data.notes.query({
    KeyConditionExpression: 'noteID = :noteID',
    ExpressionAttributeValues: {
      ':noteID': noteID
    }
  })
  res({
    html: result.Items.join('<hr>')
  })
}

exports.handler = arc.http(handler)

Next: scan