io.vertx.ext.mongo

## Class UpdateOptions

- java.lang.Object
- - io.vertx.ext.mongo.UpdateOptions

-     public class UpdateOptions
      extends Object

  Options for configuring updates.
  Author:
    Nick Scavelli

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEFAULT_MULTI` The default value of multi = false
    `static boolean` | `DEFAULT_RETURN_NEW_DOCUMENT` The default value of returning new document = false
    `static boolean` | `DEFAULT_UPSERT` The default value of upsert = false

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UpdateOptions()` Default constructor
    `UpdateOptions(boolean upsert)` Constructor specify upsert
    `UpdateOptions(boolean upsert, boolean multi)` Constructor specify upsert and multi
    `UpdateOptions(JsonObject json)` Constructor from JSON
    `UpdateOptions(UpdateOptions other)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `JsonArray` | `getArrayFilters()` Get the arrayFilters option.
    `CollationOptions` | `getCollation()`
    `JsonObject` | `getHint()` Get the hint.
    `String` | `getHintString()` Get the hint string.
    `WriteOption` | `getWriteOption()` Get the write option.
    `int` | `hashCode()`
    `boolean` | `isMulti()` Get whether multi is enabled.
    `boolean` | `isReturningNewDocument()` Get whether returning new document property is enabled.
    `boolean` | `isUpsert()` Get whether upsert is enabled
    `UpdateOptions` | `setArrayFilters(JsonArray arrayFilters)` Set the arrayFilters option
    `UpdateOptions` | `setCollation(CollationOptions collation)` Collation options
    `UpdateOptions` | `setHint(JsonObject hint)` Set the hint.
    `UpdateOptions` | `setHintString(String hintString)` Set the hint string.
    `UpdateOptions` | `setMulti(boolean multi)` Set whether multi is enabled
    `UpdateOptions` | `setReturningNewDocument(boolean returnNewDocument)` Set whether new document property is enabled.
    `UpdateOptions` | `setUpsert(boolean upsert)` Set whether upsert is enabled
    `UpdateOptions` | `setWriteOption(WriteOption writeOption)` Set the write option
    `JsonObject` | `toJson()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_UPSERT

          public static final boolean DEFAULT_UPSERT

      The default value of upsert = false
      See Also:
        Constant Field Values

    - #### DEFAULT_MULTI

          public static final boolean DEFAULT_MULTI

      The default value of multi = false
      See Also:
        Constant Field Values

    - #### DEFAULT_RETURN_NEW_DOCUMENT

          public static final boolean DEFAULT_RETURN_NEW_DOCUMENT

      The default value of returning new document = false
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UpdateOptions

          public UpdateOptions()

      Default constructor

    - #### UpdateOptions

          public UpdateOptions(boolean upsert)

      Constructor specify upsert
      Parameters:
        `upsert` - the value of upsert

    - #### UpdateOptions

          public UpdateOptions(boolean upsert,
                               boolean multi)

      Constructor specify upsert and multi
      Parameters:
        `upsert` - the value of upsert
        `multi` - the value of multi

    - #### UpdateOptions

          public UpdateOptions(UpdateOptions other)

      Copy constructor
      Parameters:
        `other` - the one to copy

    - #### UpdateOptions

          public UpdateOptions(JsonObject json)

      Constructor from JSON
      Parameters:
        `json` - the json

  - ### Method Detail

    - #### getCollation

          public CollationOptions getCollation()

    - #### setCollation

          public UpdateOptions setCollation(CollationOptions collation)

      Collation options
      Parameters:
        `collation` -

    - #### getWriteOption

          public WriteOption getWriteOption()

      Get the write option.
      Returns:
        the write option

    - #### setWriteOption

          public UpdateOptions setWriteOption(WriteOption writeOption)

      Set the write option
      Parameters:
        `writeOption` - the write option
      Returns:
        reference to this, for fluency

    - #### isUpsert

          public boolean isUpsert()

      Get whether upsert is enabled
      Returns:
        upsert is enabled?

    - #### setUpsert

          public UpdateOptions setUpsert(boolean upsert)

      Set whether upsert is enabled
      Parameters:
        `upsert` - true if enabled
      Returns:
        reference to this, for fluency

    - #### isReturningNewDocument

          public boolean isReturningNewDocument()

      Get whether returning new document property is enabled. Valid only on findOneAnd* methods.
      Returns:
        new document property is enabled?

    - #### setReturningNewDocument

          public UpdateOptions setReturningNewDocument(boolean returnNewDocument)

      Set whether new document property is enabled. Valid only on findOneAnd* methods.
      Parameters:
        `returnNewDocument` - true if enabled
      Returns:
        reference to this, for fluency

    - #### isMulti

          public boolean isMulti()

      Get whether multi is enabled. Multi means more than one document can be updated.
      Returns:
        multi is enabled?

    - #### setMulti

          public UpdateOptions setMulti(boolean multi)

      Set whether multi is enabled
      Parameters:
        `multi` - true if enabled
      Returns:
        reference to this, for fluency

    - #### getArrayFilters

          public JsonArray getArrayFilters()

      Get the arrayFilters option.
      Returns:
        the arrayFilters option

    - #### setArrayFilters

          public UpdateOptions setArrayFilters(JsonArray arrayFilters)

      Set the arrayFilters option
      Parameters:
        `arrayFilters` - the arrayFilters option
      Returns:
        reference to this, for fluency

    - #### getHint

          public JsonObject getHint()

      Get the hint.
      Returns:
        the hint

    - #### setHint

          public UpdateOptions setHint(JsonObject hint)

      Set the hint.
      Parameters:
        `hint` - the hint
      Returns:
        reference to this, for fluency

    - #### getHintString

          public String getHintString()

      Get the hint string.
      Returns:
        the hint string

    - #### setHintString

          public UpdateOptions setHintString(String hintString)

      Set the hint string.
      Parameters:
        `hintString` - the hint string
      Returns:
        reference to this, for fluency

    - #### toJson

          public JsonObject toJson()

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2024 Eclipse. All rights reserved.