kmongo / org.litote.kmongo / setValueOnInsert

setValueOnInsert

fun setValueOnInsert(value: Any): Bson (source)

Creates an update that sets the collection to the given value, but only if the update is an upsert that results in an insert of a document.

Parameters

value - the value to insert

Return
the update

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

See Also

UpdateOptions