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

intersect

infix fun <T> MongoIterable<T>.intersect(other: Iterable<T>): Set<T> (source)

Returns a set containing all elements that are contained by both this set and the specified collection.

The returned set preserves the element iteration order of the original collection.