public class UpdatesKt
@NotNull public static <T> SetTo<T> setTo(@NotNull kotlin.reflect.KProperty<? extends T> $this$setTo, T value)
Generates a class SetTo used in updateOne or updateMany operations.
class SetTo@NotNull
public static org.bson.conversions.Bson combine(@NotNull
org.bson.conversions.Bson... updates)
Combine a list of updates into a single update.
updates - the list of updates@NotNull
public static org.bson.conversions.Bson combine(@NotNull
java.util.List<? extends org.bson.conversions.Bson> updates)
Combine a list of updates into a single update.
updates - the list of updates@NotNull
public static <T> org.bson.conversions.Bson setValue(@NotNull
kotlin.reflect.KProperty<? extends T> property,
@Nullable
T value)
Creates an update that sets the value of the property to the given value.
property - the propertyvalue - the value@NotNull
public static org.bson.conversions.Bson set(@NotNull
org.litote.kmongo.SetTo... properties)
Creates an update that sets the values of the properties to the specified values.
properties - the properties to update@NotNull
public static <T> org.bson.conversions.Bson unset(@NotNull
kotlin.reflect.KProperty<? extends T> property)
Creates an update that deletes the property with the given name.
property - the property@NotNull
public static <T> org.bson.conversions.Bson setOnInsert(@NotNull
kotlin.reflect.KProperty<? extends T> property,
T value)
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.
property - the propertyvalue - the value@NotNull
public static <T> org.bson.conversions.Bson rename(@NotNull
kotlin.reflect.KProperty<? extends T> property,
@NotNull
kotlin.reflect.KProperty<? extends T> newProperty)
Creates an update that renames a field.
property - the property@NotNull public static <T extends Number> org.bson.conversions.Bson inc(@NotNull kotlin.reflect.KProperty<? extends T> property, @NotNull java.lang.Number number)
Creates an update that increments the value of the property by the given value.
property - the propertynumber - the value@NotNull public static <T extends Number> org.bson.conversions.Bson mul(@NotNull kotlin.reflect.KProperty<? extends T> property, @NotNull java.lang.Number number)
Creates an update that multiplies the value of the property by the given number.
property - the propertynumber - the non-null number@NotNull
public static <T> org.bson.conversions.Bson min(@NotNull
kotlin.reflect.KProperty<? extends T> property,
T value)
Creates an update that sets the value of the property if the given value is less than the current value of the property.
property - the propertyvalue - the value@NotNull
public static <T> org.bson.conversions.Bson max(@NotNull
kotlin.reflect.KProperty<? extends T> property,
T value)
Creates an update that sets the value of the property if the given value is greater than the current value of the property.
property - the propertyvalue - the value@NotNull
public static <T> org.bson.conversions.Bson currentDate(@NotNull
kotlin.reflect.KProperty<? extends T> property)
Creates an update that sets the value of the property to the current date as a BSON date.
property - the property@NotNull
public static <T> org.bson.conversions.Bson currentTimestamp(@NotNull
kotlin.reflect.KProperty<? extends T> property)
Creates an update that sets the value of the property to the current date as a BSON timestamp.
property - the property@NotNull
public static <T> org.bson.conversions.Bson addToSet(@NotNull
kotlin.reflect.KProperty<? extends java.lang.Iterable<? extends T>> property,
T value)
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
property - the propertyvalue - the value@NotNull
public static <T> org.bson.conversions.Bson addEachToSet(@NotNull
kotlin.reflect.KProperty<? extends java.lang.Iterable<? extends T>> property,
@NotNull
java.util.List<? extends T> values)
Creates an update that adds each of the given values to the array value of the property, unless the value is already present, in which case it does nothing
property - the propertyvalues - the values@NotNull
public static <T> org.bson.conversions.Bson push(@NotNull
kotlin.reflect.KProperty<? extends java.lang.Iterable<? extends T>> property,
T value)
Creates an update that adds the given value to the array value of the property.
property - the propertyvalue - the value@NotNull
public static <T> org.bson.conversions.Bson pushEach(@NotNull
kotlin.reflect.KProperty<? extends java.lang.Iterable<? extends T>> property,
@NotNull
java.util.List<? extends T> values,
@NotNull
com.mongodb.client.model.PushOptions options)
Creates an update that adds each of the given values to the array value of the property, applying the given options for positioning the pushed values, and then slicing and/or sorting the array.
property - the propertyvalues - the valuesoptions - the non-null push options@NotNull
public static <T> org.bson.conversions.Bson pull(@NotNull
kotlin.reflect.KProperty<? extends java.lang.Iterable<? extends T>> property,
@Nullable
T value)
Creates an update that removes all instances of the given value from the array value of the property.
property - the propertyvalue - the value@NotNull
public static org.bson.conversions.Bson pullByFilter(@NotNull
kotlin.reflect.KProperty<?> property,
@NotNull
org.bson.conversions.Bson filter)
Creates an update that removes all instances of the given value from the array value of the property.
property - the propertyfilter - the value@NotNull
public static org.bson.conversions.Bson pullByFilter(@NotNull
org.bson.conversions.Bson filter)
Creates an update that removes from an array all elements that match the given filter.
filter - the query filter@NotNull
public static <T> org.bson.conversions.Bson pullAll(@NotNull
kotlin.reflect.KProperty<? extends java.lang.Iterable<? extends T>> property,
@Nullable
java.util.List<? extends T> values)
Creates an update that removes all instances of the given values from the array value of the property.
property - the propertyvalues - the values@NotNull
public static <T> org.bson.conversions.Bson popFirst(@NotNull
kotlin.reflect.KProperty<? extends T> property)
Creates an update that pops the first element of an array that is the value of the property.
property - the property@NotNull
public static <T> org.bson.conversions.Bson popLast(@NotNull
kotlin.reflect.KProperty<? extends T> property)
Creates an update that pops the last element of an array that is the value of the property.
property - the property@NotNull public static <T extends Number> org.bson.conversions.Bson bitwiseAnd(@NotNull kotlin.reflect.KProperty<? extends T> property, int value)
Creates an update that performs a bitwise and between the given integer value and the integral value of the property.
property - the propertyvalue - the value@NotNull public static <T extends Number> org.bson.conversions.Bson bitwiseAnd(@NotNull kotlin.reflect.KProperty<? extends T> property, long value)
Creates an update that performs a bitwise and between the given long value and the integral value of the property.
property - the propertyvalue - the value@NotNull public static <T extends Number> org.bson.conversions.Bson bitwiseOr(@NotNull kotlin.reflect.KProperty<? extends T> property, int value)
Creates an update that performs a bitwise or between the given integer value and the integral value of the property.
property - the propertyvalue - the value@NotNull public static <T extends Number> org.bson.conversions.Bson bitwiseOr(@NotNull kotlin.reflect.KProperty<? extends T> property, long value)
Creates an update that performs a bitwise or between the given long value and the integral value of the property.
property - the propertyvalue - the value@NotNull public static <T extends Number> org.bson.conversions.Bson bitwiseXor(@NotNull kotlin.reflect.KProperty<? extends T> property, int value)
Creates an update that performs a bitwise xor between the given integer value and the integral value of the property.
property - the propertyvalue - the value@NotNull public static <T extends Number> org.bson.conversions.Bson bitwiseXor(@NotNull kotlin.reflect.KProperty<? extends T> property, long value)
Creates an update that performs a bitwise xor between the given long value and the integral value of the property.
property - the propertyvalue - the value@NotNull public static <T> com.mongodb.client.model.InsertOneModel<T> insertOne(T document)
Creates an InsertOneModel.
@NotNull
public static <T> com.mongodb.client.model.UpdateOneModel<T> updateOne(@NotNull
org.bson.conversions.Bson filter,
@NotNull
org.bson.conversions.Bson update,
@NotNull
com.mongodb.client.model.UpdateOptions options)
Creates an UpdateOneModel.
@NotNull
public static <T> com.mongodb.client.model.UpdateManyModel<T> updateMany(@NotNull
org.bson.conversions.Bson filter,
@NotNull
org.bson.conversions.Bson update,
@NotNull
com.mongodb.client.model.UpdateOptions options)
Creates an UpdateManyModel.
@NotNull
public static <T> com.mongodb.client.model.ReplaceOneModel<T> replaceOne(@NotNull
org.bson.conversions.Bson filter,
T replacement,
@NotNull
com.mongodb.client.model.ReplaceOptions options)
Creates an ReplaceOneModel.
@NotNull
public static <T> com.mongodb.client.model.DeleteOneModel<T> deleteOne(@NotNull
org.bson.conversions.Bson filter,
@NotNull
com.mongodb.client.model.DeleteOptions options)
Creates an DeleteOneModel.
@NotNull
public static <T> com.mongodb.client.model.DeleteManyModel<T> deleteMany(@NotNull
org.bson.conversions.Bson filter,
@NotNull
com.mongodb.client.model.DeleteOptions options)
Creates an DeleteManyModel.
@NotNull public static com.mongodb.client.model.UpdateOptions upsert()
Creates an UpdateOptions and set upsert to true.
@NotNull public static com.mongodb.client.model.ReplaceOptions replaceUpsert()
Creates an ReplaceOptions and set upsert to true.
@NotNull public static com.mongodb.client.model.FindOneAndUpdateOptions findOneAndUpdateUpsert()
Creates an FindOneAndUpdateOptions and set upsert to true.