All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lightningkite.ktordb.aggregateExtensions.kt Maven / Gradle / Ivy

The newest version!
package com.lightningkite.ktordb

import com.lightningkite.khrysalis.IsHashable


fun  Sequence>.aggregate(aggregate: Aggregate): Map {
    val aggregators = HashMap()
    for (entry in this) {
        aggregators.getOrPut(entry.first) { aggregate.aggregator() }.consume(entry.second)
    }
    return aggregators.mapValues { it.value.complete() }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy