kmongo / kotlin.collections / com.mongodb.client.MongoIterable / distinctBy

distinctBy

inline fun <T, K> MongoIterable<T>.distinctBy(crossinline selector: (T) -> K): List<T> (source)

Returns a list containing only elements from the given collection having distinct keys returned by the given selector function.

The elements in the resulting list are in the same order as they were in the source collection.