Packages

object SearchOperator

The core part of the $search pipeline stage of an aggregation pipeline.

Annotations
@Beta()
Since

4.7

See also

Search operators

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SearchOperator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def autocomplete(path: FieldSearchPath, queries: Iterable[String]): AutocompleteSearchOperator

    Returns a SearchOperator that may be used to implement search-as-you-type functionality.

    Returns a SearchOperator that may be used to implement search-as-you-type functionality.

    path

    The field to be searched.

    queries

    The non-empty strings to search for.

    returns

    The requested SearchOperator.

    See also

    autocomplete operator

  6. def autocomplete(path: FieldSearchPath, query: String, queries: String*): AutocompleteSearchOperator

    Returns a SearchOperator that may be used to implement search-as-you-type functionality.

    Returns a SearchOperator that may be used to implement search-as-you-type functionality.

    path

    The field to be searched.

    query

    The string to search for.

    queries

    More strings to search for.

    returns

    The requested SearchOperator.

    See also

    autocomplete operator

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  8. def compound(): CompoundSearchOperatorBase

    Returns a base for a SearchOperator that may combine multiple SearchOperators.

    Returns a base for a SearchOperator that may combine multiple SearchOperators. Combining SearchOperators affects calculation of the relevance score.

    returns

    A base for a CompoundSearchOperator.

    See also

    compound operator

  9. def dateRange(paths: Iterable[_ <: FieldSearchPath]): DateRangeSearchOperatorBase

    Returns a base for a SearchOperator that tests if the BSON Date values of the specified fields are within an interval.

    Returns a base for a SearchOperator that tests if the BSON Date values of the specified fields are within an interval.

    paths

    The non-empty fields to be searched.

    returns

    A base for a DateRangeSearchOperator.

    See also

    range operator

  10. def dateRange(path: FieldSearchPath, paths: FieldSearchPath*): DateRangeSearchOperatorBase

    Returns a base for a SearchOperator that tests if the BSON Date values of the specified fields are within an interval.

    Returns a base for a SearchOperator that tests if the BSON Date values of the specified fields are within an interval.

    path

    The field to be searched.

    paths

    More fields to be searched.

    returns

    A base for a DateRangeSearchOperator.

    See also

    range operator

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def exists(path: FieldSearchPath): ExistsSearchOperator

    Returns a SearchOperator that tests if the path exists in a document.

    Returns a SearchOperator that tests if the path exists in a document.

    path

    The path to test.

    returns

    The requested SearchOperator.

    See also

    exists operator

  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def near(origin: Point, pivot: Number, paths: Iterable[_ <: FieldSearchPath]): GeoNearSearchOperator

    Returns a SearchOperator that allows finding results that are near the specified origin.

    Returns a SearchOperator that allows finding results that are near the specified origin.

    origin

    The origin from which the proximity of the results is measured. The relevance score is 1 if the values of the fields are origin.

    pivot

    The positive distance in meters from the origin at which the relevance score drops in half.

    paths

    The non-empty fields to be searched.

    returns

    The requested SearchOperator.

    See also

    near operator

  19. def near(origin: Point, pivot: Number, path: FieldSearchPath, paths: FieldSearchPath*): GeoNearSearchOperator

    Returns a SearchOperator that allows finding results that are near the specified origin.

    Returns a SearchOperator that allows finding results that are near the specified origin.

    origin

    The origin from which the proximity of the results is measured. The relevance score is 1 if the values of the fields are origin.

    pivot

    The positive distance in meters from the origin at which the relevance score drops in half.

    path

    The field to be searched.

    paths

    More fields to be searched.

    returns

    The requested SearchOperator.

    See also

    near operator

  20. def near(origin: Instant, pivot: Duration, paths: Iterable[_ <: FieldSearchPath]): DateNearSearchOperator

    Returns a SearchOperator that allows finding results that are near the specified origin.

    Returns a SearchOperator that allows finding results that are near the specified origin.

    origin

    The origin from which the proximity of the results is measured. The relevance score is 1 if the values of the fields are origin.

    pivot

    The positive distance from the origin at which the relevance score drops in half. Data is extracted via Duration.toMillis.

    paths

    The non-empty fields to be searched. It is converted to long via Duration.toMillis.

    returns

    The requested SearchOperator.

    See also

    near operator

    org.bson.codecs.jsr310.InstantCodec

  21. def near(origin: Instant, pivot: Duration, path: FieldSearchPath, paths: FieldSearchPath*): DateNearSearchOperator

    Returns a SearchOperator that allows finding results that are near the specified origin.

    Returns a SearchOperator that allows finding results that are near the specified origin.

    origin

    The origin from which the proximity of the results is measured. The relevance score is 1 if the values of the fields are origin.

    pivot

    The positive distance from the origin at which the relevance score drops in half. Data is extracted via Duration.toMillis.

    path

    The field to be searched.

    paths

    More fields to be searched.

    returns

    The requested SearchOperator.

    See also

    near operator

    org.bson.codecs.jsr310.InstantCodec

  22. def near(origin: Number, pivot: Number, paths: Iterable[_ <: FieldSearchPath]): NumberNearSearchOperator

    Returns a SearchOperator that allows finding results that are near the specified origin.

    Returns a SearchOperator that allows finding results that are near the specified origin.

    origin

    The origin from which the proximity of the results is measured. The relevance score is 1 if the values of the fields are origin.

    pivot

    The positive distance from the origin at which the relevance score drops in half.

    paths

    The non-empty fields to be searched.

    returns

    The requested SearchOperator.

    See also

    near operator

  23. def near(origin: Number, pivot: Number, path: FieldSearchPath, paths: FieldSearchPath*): NumberNearSearchOperator

    Returns a SearchOperator that allows finding results that are near the specified origin.

    Returns a SearchOperator that allows finding results that are near the specified origin.

    origin

    The origin from which the proximity of the results is measured. The relevance score is 1 if the values of the fields are origin.

    pivot

    The positive distance from the origin at which the relevance score drops in half.

    path

    The field to be searched.

    paths

    More fields to be searched.

    returns

    The requested SearchOperator.

    See also

    near operator

  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  26. def numberRange(paths: Iterable[_ <: FieldSearchPath]): NumberRangeSearchOperatorBase

    Returns a base for a SearchOperator that tests if the BSON 32-bit integer / 64-bit integer / Double values of the specified fields are within an interval.

    Returns a base for a SearchOperator that tests if the BSON 32-bit integer / 64-bit integer / Double values of the specified fields are within an interval.

    paths

    The non-empty fields to be searched.

    returns

    A base for a NumberRangeSearchOperator.

    See also

    range operator

  27. def numberRange(path: FieldSearchPath, paths: FieldSearchPath*): NumberRangeSearchOperatorBase

    Returns a base for a SearchOperator that tests if the BSON 32-bit integer / 64-bit integer / Double values of the specified fields are within an interval.

    Returns a base for a SearchOperator that tests if the BSON 32-bit integer / 64-bit integer / Double values of the specified fields are within an interval.

    path

    The field to be searched.

    paths

    More fields to be searched.

    returns

    A base for a NumberRangeSearchOperator.

    See also

    range operator

  28. def of(operator: Bson): SearchOperator

    Creates a SearchOperator from a Bson in situations when there is no builder method that better satisfies your needs.

    Creates a SearchOperator from a Bson in situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.

    Example
    The following code creates two functionally equivalent SearchOperators, though they may not be equal.

    val operator1: SearchOperator = SearchOperator.exists(
      SearchPath.fieldPath("fieldName"))
    val operator2: SearchOperator = SearchOperator.of(Document("exists" ->
      Document("path" -> SearchPath.fieldPath("fieldName").toValue)))
    operator

    A Bson representing the required SearchOperator.

    returns

    The requested SearchOperator.

  29. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  30. def text(paths: Iterable[_ <: SearchPath], queries: Iterable[String]): TextSearchOperator

    Returns a SearchOperator that performs a full-text search.

    Returns a SearchOperator that performs a full-text search.

    paths

    The non-empty fields to be searched.

    queries

    The non-empty strings to search for.

    returns

    The requested SearchOperator.

    See also

    text operator

  31. def text(path: SearchPath, query: String): TextSearchOperator

    Returns a SearchOperator that performs a full-text search.

    Returns a SearchOperator that performs a full-text search.

    path

    The field to be searched.

    query

    The string to search for.

    returns

    The requested SearchOperator.

    See also

    text operator

  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped