@dxos/echo
    Preparing search index...

    Variable groupConst

    group: {
        <T, K extends string>(property: K): Aggregate.Aggregate<T, null | T[K]>;
        <T, const K extends readonly [keyof T & string, keyof T & string]>(
            key: { coalesce: K },
        ): Aggregate.Aggregate<T, null | T[K[number]]>;
    } = ...

    Group members by a scalar property, or by the first property of a coalesce chain holding a scalar value (threadId ?? id). The record key names the result field carrying the coerced group-key value; multiple group entries form a composite key (a coalesce chain is one component, not several). Members whose key is missing, null, undefined, or non-scalar group under the null key, so the field value includes null.

    A chain ending in an always-present property (e.g. { coalesce: ['threadId', 'id'] }) gives each member lacking the leading property its own singleton group instead of pooling them under null, where an items limit would truncate unrelated members. id qualifies: it resolves to the object's entity id even though documents don't store it as data.

    Type declaration

    O(1); builds an aggregate spec without evaluating anything.