object SearchOperator
The core part of the $search pipeline stage of an aggregation pipeline.
- Annotations
- @Beta()
- Since
4.7
- See also
- Alphabetic
- By Inheritance
- SearchOperator
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def autocomplete(path: FieldSearchPath, queries: Iterable[String]): AutocompleteSearchOperator
Returns a
SearchOperatorthat may be used to implement search-as-you-type functionality.Returns a
SearchOperatorthat 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
- def autocomplete(path: FieldSearchPath, query: String, queries: String*): AutocompleteSearchOperator
Returns a
SearchOperatorthat may be used to implement search-as-you-type functionality.Returns a
SearchOperatorthat 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
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def compound(): CompoundSearchOperatorBase
Returns a base for a
SearchOperatorthat may combine multipleSearchOperators.Returns a base for a
SearchOperatorthat may combine multipleSearchOperators. CombiningSearchOperators affects calculation of the relevance score.- returns
A base for a
CompoundSearchOperator.
- See also
- def dateRange(paths: Iterable[_ <: FieldSearchPath]): DateRangeSearchOperatorBase
Returns a base for a
SearchOperatorthat tests if the BSONDatevalues of the specified fields are within an interval.Returns a base for a
SearchOperatorthat tests if the BSONDatevalues of the specified fields are within an interval.- paths
The non-empty fields to be searched.
- returns
A base for a
DateRangeSearchOperator.
- See also
- def dateRange(path: FieldSearchPath, paths: FieldSearchPath*): DateRangeSearchOperatorBase
Returns a base for a
SearchOperatorthat tests if the BSONDatevalues of the specified fields are within an interval.Returns a base for a
SearchOperatorthat tests if the BSONDatevalues 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
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exists(path: FieldSearchPath): ExistsSearchOperator
Returns a
SearchOperatorthat tests if thepathexists in a document.Returns a
SearchOperatorthat tests if thepathexists in a document.- path
The path to test.
- returns
The requested
SearchOperator.
- See also
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def near(origin: Point, pivot: Number, paths: Iterable[_ <: FieldSearchPath]): GeoNearSearchOperator
Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.- 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
originat which the relevance score drops in half.- paths
The non-empty fields to be searched.
- returns
The requested
SearchOperator.
- See also
- def near(origin: Point, pivot: Number, path: FieldSearchPath, paths: FieldSearchPath*): GeoNearSearchOperator
Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.- 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
originat 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
- def near(origin: Instant, pivot: Duration, paths: Iterable[_ <: FieldSearchPath]): DateNearSearchOperator
Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.- 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
originat which the relevance score drops in half. Data is extracted viaDuration.toMillis.- paths
The non-empty fields to be searched. It is converted to
longviaDuration.toMillis.- returns
The requested
SearchOperator.
- See also
org.bson.codecs.jsr310.InstantCodec
- def near(origin: Instant, pivot: Duration, path: FieldSearchPath, paths: FieldSearchPath*): DateNearSearchOperator
Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.- 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
originat which the relevance score drops in half. Data is extracted viaDuration.toMillis.- path
The field to be searched.
- paths
More fields to be searched.
- returns
The requested
SearchOperator.
- See also
org.bson.codecs.jsr310.InstantCodec
- def near(origin: Number, pivot: Number, paths: Iterable[_ <: FieldSearchPath]): NumberNearSearchOperator
Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.- 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
originat which the relevance score drops in half.- paths
The non-empty fields to be searched.
- returns
The requested
SearchOperator.
- See also
- def near(origin: Number, pivot: Number, path: FieldSearchPath, paths: FieldSearchPath*): NumberNearSearchOperator
Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.Returns a
SearchOperatorthat allows finding results that are near the specifiedorigin.- 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
originat 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
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def numberRange(paths: Iterable[_ <: FieldSearchPath]): NumberRangeSearchOperatorBase
Returns a base for a
SearchOperatorthat tests if the BSON32-bit integer/64-bit integer/Doublevalues of the specified fields are within an interval.Returns a base for a
SearchOperatorthat tests if the BSON32-bit integer/64-bit integer/Doublevalues of the specified fields are within an interval.- paths
The non-empty fields to be searched.
- returns
A base for a
NumberRangeSearchOperator.
- See also
- def numberRange(path: FieldSearchPath, paths: FieldSearchPath*): NumberRangeSearchOperatorBase
Returns a base for a
SearchOperatorthat tests if the BSON32-bit integer/64-bit integer/Doublevalues of the specified fields are within an interval.Returns a base for a
SearchOperatorthat tests if the BSON32-bit integer/64-bit integer/Doublevalues 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
- def of(operator: Bson): SearchOperator
Creates a
SearchOperatorfrom aBsonin situations when there is no builder method that better satisfies your needs.Creates a
SearchOperatorfrom aBsonin 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 equivalentSearchOperators, 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
Bsonrepresenting the requiredSearchOperator.- returns
The requested
SearchOperator.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def text(paths: Iterable[_ <: SearchPath], queries: Iterable[String]): TextSearchOperator
Returns a
SearchOperatorthat performs a full-text search.Returns a
SearchOperatorthat 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
- def text(path: SearchPath, query: String): TextSearchOperator
Returns a
SearchOperatorthat performs a full-text search.Returns a
SearchOperatorthat performs a full-text search.- path
The field to be searched.
- query
The string to search for.
- returns
The requested
SearchOperator.
- See also
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
This is the documentation for the MongoDB Scala driver.
Driver structure
The mongodb scala driver.
To get started you need a MongoClient instance, either from a connection string or via a org.mongodb.scala.MongoClientSettings.
Notable packages include: