TableBatchGet
Table-level command to perform a batch get across multiple entity types.
Unlike BatchGet which operates on a single entity type, this command accepts
get operations from multiple entities via entity.prepare(new BatchGet({ keys: [...] }))
and returns results grouped by entity in a tuple structure.
Unprocessed keys are returned per entity in a tuple matching the input order.
Example
Section titled “Example”const { items, unprocessedKeys } = await table.send(new TableBatchGet({ gets: [ userEntity.prepare(new BatchGet({ keys: [{ userId: 'u1' }, { userId: 'u2' }], })), orderEntity.prepare(new BatchGet({ keys: [{ orderId: 'o1' }], })), ], consistent: true, // Apply strongly consistent reads to all groups}))
const [users, orders] = items// users: User[]// orders: Order[]Type Parameters
Section titled “Type Parameters”Gets extends PreparedBatchGet<any>[]
Implements
Section titled “Implements”TableCommand<TableBatchGetResult<Gets>>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TableBatchGet<Gets>(config): TableBatchGet<Gets>;Parameters
Section titled “Parameters”config
Section titled “config”TableBatchGetConfig<Gets>
Returns
Section titled “Returns”TableBatchGet<Gets>
Methods
Section titled “Methods”execute()
Section titled “execute()”execute(table): Promise<TableBatchGetResult<Gets>>;Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TableBatchGetResult<Gets>>