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

toMap

fun <K, V> MongoIterable<Pair<K, V>>.toMap(): Map<K, V> (source)

Returns a new map containing all key-value pairs from the given collection of pairs.

The returned map preserves the entry iteration order of the original collection.

fun <K, V, M : MutableMap<in K, in V>> MongoIterable<Pair<K, V>>.toMap(destination: M): M (source)

Populates and returns the destination mutable map with key-value pairs from the given collection of pairs.