Class FindOneAndUpdateOptions

java.lang.Object
com.datastax.astra.client.model.CommandOptions<FindOneAndUpdateOptions>
com.datastax.astra.client.model.FindOneAndUpdateOptions

public class FindOneAndUpdateOptions extends CommandOptions<FindOneAndUpdateOptions>
List options for a findOneAndUpdate command.
  • Constructor Details

    • FindOneAndUpdateOptions

      public FindOneAndUpdateOptions()
      Default constructor.
  • Method Details

    • sort

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

      public FindOneAndUpdateOptions sort(Map<String,Object> rawSort)
      Syntax sugar as delete option is only a sort Could be like Map.of("$vectorize", "command, "field1", 1, "field2", -1);
      Parameters:
      rawSort - raw sort clause
      Returns:
      current command.
    • sort

      public FindOneAndUpdateOptions sort(Document sorClause)
      Syntax sugar as delete option is only a sort Could be like Map.of("$vectorize", "command, "field1", 1, "field2", -1);
      Parameters:
      sorClause - sort clause as a document
      Returns:
      current command.
    • sort

      public FindOneAndUpdateOptions sort(String vectorize, Sort... sorts)
      Add a criteria with $vectorize in the sort clause.
      Parameters:
      vectorize - an expression to look for vectorization
      sorts - The sort criteria to be applied to the findOne operation.
      Returns:
      current command
    • sort

      public FindOneAndUpdateOptions 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 FindOneAndUpdateOptions projection(Projection... projection)
      Syntax sugar as delete option is only a sort
      Parameters:
      projection - add a filter
      Returns:
      current command.
    • returnDocumentAfter

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

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

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