take

Returns the first limit elements in an array, similar to kotlin.collections.take.

Example

class Player(
val _id: ObjectId,
val scores: List<Int>,
val firstScores: List<Int>,
)

players.updateManyWithPipeline {
set {
Player::firstScores set Player::scores.take(3)
}
}

External resources