ChatiumFor developersPlaygroundPricing
Sign in

HeapTableRepo.findByIds

Returns an array of heap objects with the specified identifiers. Missing records are skipped.

Usage / Signature

const rows = await table.findByIds(ctx, ids)

Arguments

  • ctx: app.Ctx
    The request context. Used for internal implementation and allows executing the request in the desired transaction.
  • ids: string[]
    A list of identifiers for the required records. The maximum allowed number is 1000 identifiers. If more are provided, an error will occur.

Return Value: Promise<HeapObject[]>

An array of heap objects.

Examples

Fetching by a list of identifiers

const Orgs = Heap.Table('orgs', {
  name: Heap.String(),
})
const orgs = await Orgs.findByIds(
  ctx,
  ['GfrQQ1xyYWndumSHlzp0chati', 'AfrDQ9xyYWndumSHlee1chati'],
)
ctx.console.log(orgs.map(org => org.name))