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

elementAtOrElse

fun <T> MongoIterable<T>.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T (source)

Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this collection.