entities.fields: computed and rollup
Value derived from other fields of the SAME row (pure arithmetic/expression, deterministic, no side effects), e.g. unit_price * amount.
Guide: Computed fields and rollups
The entities block spans these pages: entities · entities · fields · entities · computed & rollups · entities · rules · entities · hooks · entities · indexes.
entities.<name>.fields.<name>.computed
Section titled “entities.<name>.fields.<name>.computed”Value derived from other fields of the SAME row (pure arithmetic/expression, deterministic, no side effects), e.g. unit_price * amount. May also reference this entity’s rollup fields (the framework maintains the value). Field becomes read-only.
- Type:
string - Required: no
- Not allowed together with
rollup.
entities.<name>.fields.<name>.rollup
Section titled “entities.<name>.fields.<name>.rollup”Value aggregated over RELATED records, transactionally consistent (e.g. sum of child line_total). Framework maintains it; the field is read-only.
- Type:
object - Required: no
- Not allowed together with
computed.
entities.<name>.fields.<name>.rollup.from
Section titled “entities.<name>.fields.<name>.rollup.from”Child entity that references this one.
- Type:
string - Required: yes
- Pattern:
^[a-z][a-z0-9_-]{0,62}$
entities.<name>.fields.<name>.rollup.op
Section titled “entities.<name>.fields.<name>.rollup.op”Aggregate operation over the child records.
- Type:
string - Required: yes
- Values:
"sum","count","avg","min","max"
entities.<name>.fields.<name>.rollup.field
Section titled “entities.<name>.fields.<name>.rollup.field”Field on the child entity to aggregate (required for all ops except count).
- Type:
string - Required: no
- Pattern:
^[a-z][a-z0-9_-]{0,62}$ - Required unless
opis"count".
entities.<name>.fields.<name>.rollup.via
Section titled “entities.<name>.fields.<name>.rollup.via”The FK field on the child entity that points back to this parent. Required when the child has more than one ref to this parent (e.g. follows.follower vs follows.followee).
- Type:
string - Required: no
- Pattern:
^[a-z][a-z0-9_-]{0,62}$
entities.<name>.fields.<name>.rollup.where
Section titled “entities.<name>.fields.<name>.rollup.where”Optional CEL filter on child records.
- Type:
string - Required: no