driver-core/src/main/com/mongodb/client/model/Updates.java
public static <TItem> Bson setOnInsert(final String fieldName, @Nullable final TItem value) {
        return new SimpleUpdate<TItem>(fieldName, value, "$setOnInsert");
    }
public static <TItem> Bson setOnInsert(final String fieldName, @Nullable final TItem value) {
        return new SimpleUpdate<TItem>(fieldName, value, "$setOnInsert");
    }
Creates an update that sets the value of the field with the given name to the given value, but only if the update is an upsert that
results in an insert of a document.

@param fieldName the non-null field name
@param value     the value, which may be null
@param <TItem>   the value type
@return the update
@mongodb.driver.manual reference/operator/update/setOnInsert/ $setOnInsert
@see UpdateOptions#upsert(boolean)