Class FindOneAndReplaceOptions

java.lang.Object
com.datastax.astra.client.model.FindOneAndReplaceOptions

public class FindOneAndReplaceOptions extends Object
Options used in the `findAndReplace` command.
  • Constructor Details

    • FindOneAndReplaceOptions

      public FindOneAndReplaceOptions()
      Default constructor.
  • Method Details

    • sort

      public FindOneAndReplaceOptions sort(Sort... sort)
      Syntax sugar as delete option is only a sort
      Parameters:
      sort - add a filter
      Returns:
      current command.
    • sort

      public FindOneAndReplaceOptions sort(String vectorize, Sort... sorts)
      Add a criteria with $vectorize in the sort clause

      Note : This feature is under current development.

      Parameters:
      vectorize - an expression to look for vectorization
      sorts - The sort criteria to be applied to the findOne operation.
      Returns:
      current command
    • sort

      public FindOneAndReplaceOptions sort(float[] vector, Sort... sorts)
      Add a criteria with $vector in the sort clause
      Parameters:
      vector - vector float
      sorts - The sort criteria to be applied to the findOne operation.
      Returns:
      current command
    • projection

      public FindOneAndReplaceOptions projection(Projection... projection)
      Syntax sugar as delete option is only a sort
      Parameters:
      projection - add a filter
      Returns:
      current command.
    • returnDocumentAfter

      public FindOneAndReplaceOptions returnDocumentAfter()
      Builder Pattern, update the returnDocument flag
      Returns:
      self reference
    • returnDocumentBefore

      public FindOneAndReplaceOptions returnDocumentBefore()
      Builder Pattern, update the returnDocument flag
      Returns:
      self reference
    • upsert

      public FindOneAndReplaceOptions upsert(Boolean upsert)
      Builder Pattern, update the upsert flag.
      Parameters:
      upsert - upsert flag
      Returns:
      self reference