Skip to content

Helpers

Utility methods for SingleTable operations.

createSet

Creates a DynamoDB Set. Normalizes Set creation across SDK v2 and v3.

Method Signature

typescript
createSet<T>(items: T[]): DBSet<T[number]>

Parameters

  • items - Array of strings or numbers

Return Value

Returns a DynamoDB Set.

Example

typescript
await table.create({
  key: {
    partitionKey: 'ITEM#1',
    rangeKey: '#DATA'
  },
  item: {
    id: '1',
    tags: table.createSet(['tag1', 'tag2', 'tag3']),
    counts: table.createSet([1, 2, 3])
  }
});

toTransactionParams

See transaction page.

ejectTransactParams

See transaction page.

See Also