sum

open infix fun <T : Number> Field<Into, T>.sum(value: Value<From, Number>)(source)
open infix fun <T : Number> KProperty1<Into, T>.sum(value: Value<From, Number>)(source)

Calculates and returns the collective sum of numeric values. Non-numeric values are ignored.

Example

class User(
val name: String,
val balance: Int,
)

class Result(
val totalBalance: Int,
)

users.aggregate()
.group {
Result::totalBalance sum of(User::balance)
}

External resources