Requests a collection as rows of computed values rather than as items: each Binding key names a result and
the Expression that computes it, from a property path optionally piped through transforms
and aggregates. Reach for it to compute totals, ranges, and category counts server-side, in the same call that
retrieves the data, rather than fetching items and reducing them client-side.
constprojection: Projection = { "vendor=vendor": { name: {} }, // group by vendor, expanded "items=count:": {}, // items per vendor "avgPrice=avg:price": {} // average price per vendor };
Each binding yields one Cell per row, holding a single value, so a binding never nests a Projection. A
projection stands as the entry of the Template field naming the collection, carrying that collection's
Criteria alongside its bindings.
Important
A projection MUST include at least one binding: the empty object {} is an Atomic. The type admits it only
because TypeScript cannot express a non-empty index signature; isProjection rejects it at runtime.
Important
Result names (the Identifier portion before =) MUST be unique within a projection: duplicates collide
on the same cell and are rejected.
Important
A projection yields distinct rows: rows with the same combination of cell values collapse into one, across
the whole collection. Include an identifying binding such as "id=id" to keep otherwise-equal items apart.
Important
When any binding resolves to an aggregate Expression, the collection is evaluated under grouped semantics
and the non-aggregate bindings form the grouping key; see Criteria for how constraints partition across
the grouping.
Collection property projection.
Requests a collection as rows of computed values rather than as items: each Binding key names a result and the Expression that computes it, from a property path optionally piped through transforms and aggregates. Reach for it to compute totals, ranges, and category counts server-side, in the same call that retrieves the data, rather than fetching items and reducing them client-side.
Each binding yields one Cell per row, holding a single value, so a binding never nests a
Projection. A projection stands as the entry of the Template field naming the collection, carrying that collection's Criteria alongside its bindings.A projection MUST include at least one binding: the empty object
{}is an Atomic. The type admits it only because TypeScript cannot express a non-empty index signature; isProjection rejects it at runtime.Result names (the Identifier portion before
=) MUST be unique within a projection: duplicates collide on the same cell and are rejected.A projection yields distinct rows: rows with the same combination of cell values collapse into one, across the whole collection. Include an identifying binding such as
"id=id"to keep otherwise-equal items apart.When any binding resolves to an aggregate Expression, the collection is evaluated under grouped semantics and the non-aggregate bindings form the grouping key; see Criteria for how constraints partition across the grouping.