toSortedSet

fun <T : Comparable<T>> MongoIterable<T>.toSortedSet(): SortedSet<T>

Returns a SortedSet of all elements.


fun <T> MongoIterable<T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T>

Returns a SortedSet of all elements.

Elements in the set returned are sorted according to the given comparator.