kmongo / org.litote.kmongo / addToSet

addToSet

fun <T> addToSet(property: KProperty<Iterable<T>?>, value: T): Bson (source)

Creates an update that adds the given value to the array value of the property, unless the value is already present, in which case it does nothing

Parameters

property - the property

value - the value

Parameters

Return
the update

Mongodb
.driver.manual reference/operator/update/addToSet/ $addToSet