Skip to main content
Resolve an endpoint with ctx.get and a bounded inverse with ctx.list on an index that serves it. A query combines those results at one version and returns a projection. Keep every selection bounded with .first(n), or page it.

Maintained totals

For counts and exact sums per group, declare a total on the table. The host maintains it on every write, so a read never scans the facts:
  • group names one to four fields. .total() answers the groups whose group starts with the .where fields, each { key, count, sum }.
  • sum maps t.decimal fields to their fixed scale and t.int fields to 0. The sums are exact: a Decimal or a bigint.
  • erased: true keeps counting facts after they are erased, and sums nothing.
A .total() that no declared total serves is refused with the total to add. ctx.count(selection) is always exact as well, but reads the selection. For an aggregation beyond that, compute and publish a result with Pipelines.