Interface ClientUpdateOneOptions


@Sealed public interface ClientUpdateOneOptions
The options to apply when updating a document.
Since:
5.3
  • Method Details

    • clientUpdateOneOptions

      static ClientUpdateOneOptions clientUpdateOneOptions()
      Creates the default options.
      Returns:
      The default options.
    • arrayFilters

      ClientUpdateOneOptions arrayFilters(@Nullable Iterable<? extends Bson> arrayFilters)
      Sets the filters specifying to which array elements an update should apply.
      Parameters:
      arrayFilters - The array filters. null represents the server default.
      Returns:
      this.
      See Also:
    • collation

      Sets the collation.
      Parameters:
      collation - The collation. null represents the server default.
      Returns:
      this.
    • hint

      Sets the index specification, null-ifies hint string.
      Parameters:
      hint - The index specification. null represents the server default.
      Returns:
      this.
    • hintString

      ClientUpdateOneOptions hintString(@Nullable String hintString)
      Sets the index name, null-ifies hint.
      Parameters:
      hintString - The index name. null represents the server default.
      Returns:
      this.
    • upsert

      Enables or disables creation of a document if no documents match the filter.
      Parameters:
      upsert - The upsert flag. null represents the server default.
      Returns:
      this.
    • sort

      Sets the sort criteria to apply to the operation. A null value means no sort criteria is set.

      The sort criteria determines which document the operation updates if the query matches multiple documents. The first document matched by the specified sort criteria will be updated.

      Parameters:
      sort - The sort criteria. null represents the server default.
      Returns:
      this
      Since:
      5.4
      MongoDB documentation
      Sort
      Since server release
      8.0