useCursor

fun <T, R> MongoIterable<T>.useCursor(block: (Iterable<T>) -> R): R

Iterates over the MongoIterable cursor (the cursor is closed after the call).