MongoDB request DSL • opensavvy.ktmongo.dsl.aggregation.operators • ArrayValueOperators • map
map¶
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)
}
}
}
External resources¶
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)
}
}
}
External resources¶
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)
}
}
}
External resources¶
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)
}
}
}