Lattice Grid Buy a licence

Data Router ยท console.warn

join aggregate "{name}" ({fn}) needs a field...

Printed by Data Router, prefixed [lattice], since 1.84.0.

Warnings reference › data-router:join-aggregate-no-field

Identifier
data-router:join-aggregate-no-field
Raised by
Data Router
Since
1.84.0

What happened

A rollup-onto-parent join's reducer - sum, avg, min, max, distinctCount, first or last - was declared without the child field it reduces over. The named result is omitted; count is the one reducer that needs no field.

The fix

Add the child field: field: 'amount'. Only count may omit it.

The smallest fix

join: { from: 'line', foreignKey: 'orderId', many: true, aggregate: { lineTotal: { field: 'amount', fn: 'sum' } } }

Reference

Covered in full at the API reference.