map
open fun <Context : Any, T, R> Value<Context, Collection<T>>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>(source)
open fun <Context : Any, T, R> Field<Context, Collection<T>>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>(source)
open fun <Context : Any, T, R> KProperty1<Context, Collection<T>>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>(source)
open fun <Context : Any, T, R> Collection<T>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>(source)
Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.
Example
class Player(
val _id: ObjectId,
val scores: List<Int>,
)
players.updateManyWithPipeline {
set {
Player::scores set Player::scores
.map {
it + of(1)
}
}
}
Content copied to clipboard