addToSet

infix fun <T> KProperty<T>.addToSet(expression: T): BsonField

Gets a field name for a $group operation representing all unique values that results from applying the given expression to each document in a group of documents that share the same group by key.

Return

the field

Parameters

expression

the expression

the expression type

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

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

Return

the update

Parameters

property

the property

value

the value

the value type