Packages

object Updates

A factory for document updates. A convenient way to use this class is to statically import all of its methods, which allows usage like:

collection.updateOne(eq("x", 1), set("x", 2))

Since

1.0

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Updates
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addEachToSet[TItem](fieldName: String, values: TItem*): Bson

    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

    TItem

    the value type

    fieldName

    the non-null field name

    values

    the values

    returns

    the update

    See also

    $addToSet

  5. def addToSet[TItem](fieldName: String, value: TItem): Bson

    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

    TItem

    the value type

    fieldName

    the non-null field name

    value

    the value

    returns

    the update

    See also

    $addToSet

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def bitwiseAnd(fieldName: String, value: Long): Bson

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

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

    fieldName

    the field name

    value

    the value

    returns

    the update

    See also

    $bit

  8. def bitwiseAnd(fieldName: String, value: Int): Bson

    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.

    fieldName

    the field name

    value

    the value

    returns

    the update

  9. def bitwiseOr(fieldName: String, value: Long): Bson

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

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

    fieldName

    the field name

    value

    the value

    returns

    the update

    See also

    $bit

  10. def bitwiseOr(fieldName: String, value: Int): Bson

    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.

    fieldName

    the field name

    value

    the value

    returns

    the update

    See also

    $bit

  11. def bitwiseXor(fieldName: String, value: Long): Bson

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

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

    fieldName

    the field name

    value

    the value

    returns

    the update

  12. def bitwiseXor(fieldName: String, value: Int): Bson

    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.

    fieldName

    the field name

    value

    the value

    returns

    the update

  13. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  14. def combine(updates: Bson*): Bson

    Combine a list of updates into a single update.

    Combine a list of updates into a single update.

    updates

    the list of updates

    returns

    a combined update

  15. def currentDate(fieldName: String): Bson

    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.

    fieldName

    the non-null field name

    returns

    the update

    See also

    Date

    $currentDate

  16. def currentTimestamp(fieldName: String): Bson

    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.

    fieldName

    the non-null field name

    returns

    the update

    See also

    Timestamp

    $currentDate

  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def inc(fieldName: String, number: Number): Bson

    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.

    fieldName

    the non-null field name

    number

    the value

    returns

    the update

    See also

    $inc

  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def max[TItem](fieldName: String, value: TItem): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    value

    the value

    returns

    the update

    See also

    $min

  25. def min[TItem](fieldName: String, value: TItem): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    value

    the value

    returns

    the update

    See also

    $min

  26. def mul(fieldName: String, number: Number): Bson

    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.

    fieldName

    the non-null field name

    number

    the non-null number

    returns

    the update

    See also

    $mul

  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. def popFirst(fieldName: String): Bson

    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.

    fieldName

    the non-null field name

    returns

    the update

    See also

    $pop

  31. def popLast(fieldName: String): Bson

    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.

    fieldName

    the non-null field name

    returns

    the update

    See also

    $pop

  32. def pull[TItem](fieldName: String, value: TItem): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    value

    the value

    returns

    the update

    See also

    $pull

  33. def pullAll[TItem](fieldName: String, values: TItem*): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    values

    the values

    returns

    the update

    See also

    $pull

  34. def pullByFilter(filter: Bson): Bson

    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.

    filter

    the query filter

    returns

    the update

    See also

    $pull

  35. def push[TItem](fieldName: String, value: TItem): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    value

    the value

    returns

    the update

    See also

    $push

  36. def pushEach[TItem](fieldName: String, options: com.mongodb.client.model.PushOptions, values: TItem*): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    options

    the non-null push options

    values

    the values

    returns

    the update

    See also

    $push

  37. def pushEach[TItem](fieldName: String, values: TItem*): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    values

    the values

    returns

    the update

    See also

    $push

  38. def rename(fieldName: String, newFieldName: String): Bson

    Creates an update that renames a field.

    Creates an update that renames a field.

    fieldName

    the non-null field name

    newFieldName

    the non-null new field name

    returns

    the update

    See also

    $rename

  39. def set[TItem](fieldName: String, value: TItem): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    value

    the value

    returns

    the update

    See also

    $set

  40. def setOnInsert[TItem](fieldName: String, value: TItem): Bson

    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.

    TItem

    the value type

    fieldName

    the non-null field name

    value

    the value

    returns

    the update

    See also

    UpdateOptions#upsert(boolean)

    $setOnInsert

  41. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  42. def toString(): String
    Definition Classes
    AnyRef → Any
  43. def unset(fieldName: String): Bson

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

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

    fieldName

    the non-null field name

    returns

    the update

    See also

    $unset

  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped