@metreeca/qest - v0.10.0
    Preparing search index...

    Type Alias Projection

    Projection: { readonly [field: `${string}=${string}`]: Model | undefined }

    Collection property projection.

    A field map for projected collection retrieval. Each field is keyed by a Binding naming an Expression (a property path, optionally piped through a computed or aggregate transform) and maps to a Model single-value cell, or to undefined marking an optional binding that may be elided at construction time (for example, conditionally included aggregates). A Model cell takes one of the forms admitted by Projection Composition:

    • a Union placeholder — a per-branch keyed form, when the bound expression resolves to a union-typed value
    • a Placeholder — a Literal, a Reference to a linked resource, or a nested Template for inline resource expansion
    • a Locales placeholder — a tag-range-keyed map declaring a localised cell that yields a complete Dictionary value for the row's owning resource. The map is materialised by deferred expansion: pass 1 projects the owning resource handle, pass 2 batch-fetches the tagged values and assembles the map (see Projection Composition)

    Projection differs from Template along two axes:

    • keys — a Projection accepts bindings in the name=expression form, naming computed or aggregate values derived from property paths and transforms; a Template accepts only plain Identifier keys matching actual resource properties
    • values — a Projection admits a Model single-value placeholder per cell (Union, Placeholder, or Locales) but excludes the collection-valued Query, because Projection Composition allots one value per cell; a Locales map counts as a single (structured) Dictionary value, and nested Template placeholders remain admitted through Placeholder, so a computed binding may expand a linked resource inline
    Important

    When any binding resolves to an aggregate Expression (one whose pipe includes an aggregate Transform), the query is evaluated under grouped semantics; see Selection for the full grouping and filter-partition rules. With no aggregate in either the Projection or the sibling Selection, every row is projected independently and no grouping is applied.

    Important

    Projection rows are distinct: rows with the same combination of cell values collapse into one, so a Projection yields the set of distinct binding tuples rather than a multiset; distinctness spans the whole collection, folding both fan-out duplicates and equal tuples from different items. Include an identifying binding such as id to keep otherwise-equal items on separate rows (see Projection).

    Important

    Binding identifiers (the Identifier portion before =) must be unique within a Projection. Duplicates collide on the same projected property in the resulting row and are rejected by template processors.

    Note

    An empty Projection ({}), which may only appear as a collection tuple's element, carries no column bindings and must be ignored by processors as if the owning field were omitted from the enclosing template.

    Type Declaration

    • readonly [field: `${string}=${string}`]: Model | undefined
    • Model for the single-value cell forms admitted per binding
    • resource!Resource for the corresponding state type