setValueOnInsert

fun setValueOnInsert(value: Any): Bson

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.

Return

the update

Parameters

value

the value to insert

See also

UpdateOptions

#upsert(boolean)