Class FindOptions


public class FindOptions extends CommandOptions<FindOneOptions>
List Options for a FindOne command.
  • Constructor Details

    • FindOptions

      public FindOptions()
      Default constructor.
  • Method Details

    • sort

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

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

      public FindOptions includeSimilarity()
      Fluent api.
      Returns:
      add a filter
    • includeSortVector

      public FindOptions includeSortVector()
      Fluent api.
      Returns:
      add a filter
    • pageState

      public FindOptions pageState(String pageState)
      Update page state
      Parameters:
      pageState - new value for page state
      Returns:
      self reference
    • skip

      public FindOptions skip(int skip)
      Add a skip clause in the find block
      Parameters:
      skip - value for skip options
      Returns:
      current command
    • limit

      public FindOptions limit(int limit)
      Add a limit clause in the find block
      Parameters:
      limit - value for limit options
      Returns:
      current command