lastOrNull

fun <T> MongoIterable<T>.lastOrNull(): T?

Returns the last element, or null if the collection is empty.


inline fun <T> MongoIterable<T>.lastOrNull(crossinline predicate: (T) -> Boolean): T?

Returns the last element matching the given predicate, or null if no such element was found.