Update

mongo4cats.operations.Update
See theUpdate companion object
trait Update

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

def addEachToSet[A](fieldName: String, values: Seq[A]): Update

Creates an update that adds each of the given values to the array value of the field with the given name, unless the value is already present, in which case it does nothing

Creates an update that adds each of the given values to the array value of the field with the given name, unless the value is already present, in which case it does nothing

Attributes

fieldName

the non-null field name

values

the values

Returns:

the update

def addToSet[A](fieldName: String, value: A): Update

Creates an update that adds the given value to the array value of the field with the given name, unless the value is already present, in which case it does nothing

Creates an update that adds the given value to the array value of the field with the given name, unless the value is already present, in which case it does nothing

Attributes

fieldName

the non-null field name

value

the value, which may be null

Returns:

the update

def bitwiseAnd(fieldName: String, value: Int): Update

Creates an update that performs a bitwise and between the given integer value and the integral value of the field with the given name.

Creates an update that performs a bitwise and between the given integer value and the integral value of the field with the given name.

Attributes

fieldName

the field name

value

the value

Returns:

the update

def bitwiseAnd(fieldName: String, value: Long): Update
def bitwiseOr(fieldName: String, value: Int): Update

Creates an update that performs a bitwise or between the given integer value and the integral value of the field with the given name.

Creates an update that performs a bitwise or between the given integer value and the integral value of the field with the given name.

Attributes

fieldName

the field name

value

the value

Returns:

the update

def bitwiseOr(fieldName: String, value: Long): Update
def bitwiseXor(fieldName: String, value: Int): Update

Creates an update that performs a bitwise xor between the given integer value and the integral value of the field with the given name.

Creates an update that performs a bitwise xor between the given integer value and the integral value of the field with the given name.

Attributes

fieldName

the field name

value

the value

Returns:

the update

def bitwiseXor(fieldName: String, value: Long): Update
def combinedWith(anotherUpdate: Update): Update

Merges 2 sequences of update operations together.

Merges 2 sequences of update operations together.

Attributes

anotherUpdate

the update to be merged with

Returns:

the update

def currentDate(fieldName: String): Update

Creates an update that sets the value of the field to the current date as a BSON date.

Creates an update that sets the value of the field to the current date as a BSON date.

Attributes

fieldName

the non-null field name

Returns:

the update

def currentTimestamp(fieldName: String): Update

Creates an update that sets the value of the field to the current date as a BSON timestamp.

Creates an update that sets the value of the field to the current date as a BSON timestamp.

Attributes

fieldName

the non-null field name

Returns:

the update

def inc(fieldName: String, number: Number): Update

Creates an update that increments the value of the field with the given name by the given value.

Creates an update that increments the value of the field with the given name by the given value.

Attributes

fieldName

the non-null field name

number

the value

Returns:

the update

def max[A](fieldName: String, value: A): Update

Creates an update that sets the value of the field to the given value if the given value is greater than the current value of the field.

Creates an update that sets the value of the field to the given value if the given value is greater than the current value of the field.

Attributes

fieldName

the non-null field name

value

the value

Returns:

the update

def min[A](fieldName: String, value: A): Update

Creates an update that sets the value of the field to the given value if the given value is less than the current value of the field.

Creates an update that sets the value of the field to the given value if the given value is less than the current value of the field.

Attributes

fieldName

the non-null field name

value

the value

Returns:

the update

def mul(fieldName: String, number: Number): Update

Creates an update that multiplies the value of the field with the given name by the given number.

Creates an update that multiplies the value of the field with the given name by the given number.

Attributes

fieldName

the non-null field name

number

the non-null number

Returns:

the update

def popFirst(fieldName: String): Update

Creates an update that pops the first element of an array that is the value of the field with the given name.

Creates an update that pops the first element of an array that is the value of the field with the given name.

Attributes

fieldName

the non-null field name

Returns:

the update

def popLast(fieldName: String): Update

Creates an update that pops the last element of an array that is the value of the field with the given name.

Creates an update that pops the last element of an array that is the value of the field with the given name.

Attributes

fieldName

the non-null field name

Returns:

the update

def pull[A](fieldName: String, value: A): Update

Creates an update that removes all instances of the given value from the array value of the field with the given name.

Creates an update that removes all instances of the given value from the array value of the field with the given name.

Attributes

fieldName

the non-null field name

value

the value, which may be null

Returns:

the update

def pullAll[A](fieldName: String, values: Seq[A]): Update

Creates an update that removes all instances of the given values from the array value of the field with the given name.

Creates an update that removes all instances of the given values from the array value of the field with the given name.

Attributes

fieldName

the non-null field name

values

the values

Returns:

the update

def pullByFilter(filter: Filter): Update

Creates an update that removes from an array all elements that match the given filter.

Creates an update that removes from an array all elements that match the given filter.

Attributes

filter

the query filter

Returns:

the update

def push[A](fieldName: String, value: A): Update

Creates an update that adds the given value to the array value of the field with the given name.

Creates an update that adds the given value to the array value of the field with the given name.

Attributes

fieldName

the non-null field name

value

the value, which may be null

Returns:

the update

def pushEach[A](fieldName: String, values: Seq[A]): Update

Creates an update that adds each of the given values to the array value of the field with the given name.

Creates an update that adds each of the given values to the array value of the field with the given name.

Attributes

fieldName

the non-null field name

values

the values

Returns:

the update

def pushEach[A](fieldName: String, values: Seq[A], options: PushOptions): Update

Creates an update that adds each of the given values to the array value of the field with the given name, applying the given options for positioning the pushed values, and then slicing and/or sorting the array.

Creates an update that adds each of the given values to the array value of the field with the given name, applying the given options for positioning the pushed values, and then slicing and/or sorting the array.

Attributes

fieldName

the non-null field name

options

the non-null push options

values

the values

Returns:

the update

def rename(fieldName: String, newFieldName: String): Update

Creates an update that renames a field.

Creates an update that renames a field.

Attributes

fieldName

the non-null field name

newFieldName

the non-null new field name

Returns:

the update

def set[A](fieldName: String, value: A): Update

Creates an update that sets the value of the field with the given name to the given value.

Creates an update that sets the value of the field with the given name to the given value.

Attributes

fieldName

the non-null field name

value

the value, which may be null

Returns:

the update

def setOnInsert(value: Bson): Update

Creates an update that sets the values for the document, but only if the update is an upsert that results in an insert of a document.

Creates an update that sets the values for the document, but only if the update is an upsert that results in an insert of a document.

Attributes

value

the value

Returns:

the update .0

See also:

UpdateOptions#upsert(boolean)

def setOnInsert[A](fieldName: String, value: A): Update

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.

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.

Attributes

fieldName

the non-null field name

value

the value, which may be null

Returns:

the update ee UpdateOptions#upsert(boolean)

def unset(fieldName: String): Update

Creates an update that deletes the field with the given name.

Creates an update that deletes the field with the given name.

Attributes

fieldName

the non-null field name

Returns:

the update