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

last

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

Returns the last element.

Exceptions

NoSuchElementException - if the collection is empty.

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

Returns the last element matching the given predicate.

Exceptions

NoSuchElementException - if no such element is found.