last

fun <T> MongoIterable<T>.last(): T

Returns the last element.

Throws

if the collection is empty.


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

Returns the last element matching the given predicate.

Throws

if no such element is found.