Data Router ยท console.warn
join aggregate "{name}" uses fn "{fn}", whic...
Printed by Data Router, prefixed [lattice], since 1.84.0.
Warnings reference › data-router:join-aggregate-bad-fn
- Identifier
data-router:join-aggregate-bad-fn- Raised by
- Data Router
- Since
- 1.84.0
What happened
A rollup-onto-parent join's aggregate map names a reducer the router does not know. The named result is omitted from the parent row - the other reducers in the map still compute - rather than the router throwing or inventing a value.
The fix
Use one of the supported fn names: count, sum, avg, min, max, distinctCount, first or last.
The smallest fix
join: { from: 'line', foreignKey: 'orderId', many: true, aggregate: { lineTotal: { field: 'amount', fn: 'sum' } } }
Reference
Covered in full at the API reference.