Skip to content

key

function key(...parts): string;

Builds a DynamoDB key from the given parts by concatenating them with a ’#’ separator. At least one part must be provided, or a DocumentBuilderError will be thrown.

DynamoKeyableValue[]

The parts to combine into a key.

string

The combined key as a string.

const key1 = key('USER', 123) // 'USER#123'
const key2 = key('METADATA') // 'METADATA'