fun <T> setOnInsert(property: KProperty<T?>, value: T): Bson
(source)
Creates an update that sets the value of the property to the given value, but only if the update is an upsert that results in an insert of a document.
Parameters
Return
the update
Mongodb
.driver.manual reference/operator/update/setOnInsert/ $setOnInsert
See Also