Update

mongo4cats.operations.Update
See theUpdate companion class
object Update extends Update

Attributes

Companion
class
Graph
Supertypes
class Update
trait AsJavaConverters
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
Update.type

Members list

Value members

Inherited 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

Value parameters

fieldName

the non-null field name

values

the values

Attributes

Returns

the update

Inherited from:
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

Value parameters

fieldName

the non-null field name

value

the value, which may be null

Attributes

Returns

the update

Inherited from:
Update
def asJava[K, V](m: Map[K, V]): ConcurrentMap[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[K, V](m: Map[K, V]): Map[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[K, V](m: Map[K, V]): Map[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Set[A]): Set[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Set[A]): Set[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Seq[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Seq[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](b: Buffer[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](i: Iterable[A]): Iterable[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](i: Iterator[A]): Iterator[A]

Attributes

Inherited from:
AsJavaConverters
def asJavaCollection[A](i: Iterable[A]): Collection[A]

Attributes

Inherited from:
AsJavaConverters
def asJavaDictionary[K, V](m: Map[K, V]): Dictionary[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJavaEnumeration[A](i: Iterator[A]): Enumeration[A]

Attributes

Inherited from:
AsJavaConverters
def bitwiseAnd(fieldName: String, value: Long): Update

Attributes

Inherited from:
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.

Value parameters

fieldName

the field name

value

the value

Attributes

Returns

the update

Inherited from:
Update
def bitwiseOr(fieldName: String, value: Long): Update

Attributes

Inherited from:
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.

Value parameters

fieldName

the field name

value

the value

Attributes

Returns

the update

Inherited from:
Update
def bitwiseXor(fieldName: String, value: Long): Update

Attributes

Inherited from:
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.

Value parameters

fieldName

the field name

value

the value

Attributes

Returns

the update

Inherited from:
Update
def combinedWith(anotherUpdate: Update): Update

Merges 2 sequences of update operations together.

Merges 2 sequences of update operations together.

Value parameters

anotherUpdate

the update to be merged with

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

Attributes

Returns

the update

Inherited from:
Update
override def equals(other: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Update -> Any
Inherited from:
Update
override def hashCode(): Int

Calculates a hash code value for the object.

Calculates a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Update -> Any
Inherited from:
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.

Value parameters

fieldName

the non-null field name

number

the value

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

value

the value

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

value

the value

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

number

the non-null number

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

value

the value, which may be null

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

values

the values

Attributes

Returns

the update

Inherited from:
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.

Value parameters

filter

the query filter

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

value

the value, which may be null

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

options

the non-null push options

values

the values

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

values

the values

Attributes

Returns

the update

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

Creates an update that renames a field.

Creates an update that renames a field.

Value parameters

fieldName

the non-null field name

newFieldName

the non-null new field name

Attributes

Returns

the update

Inherited from:
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.

Value parameters

fieldName

the non-null field name

value

the value, which may be null

Attributes

Returns

the update

Inherited from:
Update
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.

Value parameters

fieldName

the non-null field name

value

the value, which may be null

Attributes

Returns

the update ee UpdateOptions#upsert(boolean)

Inherited from:
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.

Value parameters

value

the value

Attributes

Returns

the update .0

See also

UpdateOptions#upsert(boolean)

Inherited from:
Update
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Update -> Any
Inherited from:
Update
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.

Value parameters

fieldName

the non-null field name

Attributes

Returns

the update

Inherited from:
Update