reactivemongo.api.collections

GenericQueryBuilder

trait GenericQueryBuilder[P <: SerializationPack] extends AnyRef

A builder that helps to make a fine-tuned query to MongoDB.

When the query is ready, you can call cursor to get a Cursor, or one if you want to retrieve just one document.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. GenericQueryBuilder
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Self <: GenericQueryBuilder[pack.type]

Abstract Value Members

  1. abstract def collection: Collection

  2. abstract def commentString: Option[String]

  3. abstract def copy(queryOption: Option[P.Document] = queryOption, sortOption: Option[P.Document] = sortOption, projectionOption: Option[P.Document] = projectionOption, hintOption: Option[P.Document] = hintOption, explainFlag: Boolean = explainFlag, snapshotFlag: Boolean = snapshotFlag, commentString: Option[String] = commentString, options: QueryOpts = options, failover: FailoverStrategy = failover, maxTimeMsOption: Option[Long] = maxTimeMsOption): Self

  4. abstract def explainFlag: Boolean

  5. abstract def failover: FailoverStrategy

  6. abstract def hintOption: Option[P.Document]

  7. abstract def maxTimeMsOption: Option[Long]

  8. abstract def options: QueryOpts

  9. abstract val pack: P

  10. abstract def projectionOption: Option[P.Document]

  11. abstract def queryOption: Option[P.Document]

  12. abstract def snapshotFlag: Boolean

  13. abstract def sortOption: Option[P.Document]

  14. abstract def merge(readPreference: ReadPreference): P.Document

    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.0) Will be removed from the public API

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (GenericQueryBuilder[P], B)

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to ArrowAssoc[GenericQueryBuilder[P]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def comment(message: String): Self

    Adds a comment to this query, that may appear in the MongoDB logs.

  11. def cursor[T](readPreference: ReadPreference = ReadPreference.primary, isMongo26WriteOp: Boolean = false)(implicit reader: P.Reader[T], ec: ExecutionContext, cp: CursorProducer[T]): ProducedCursor

    Makes a Cursor of this query, which can be enumerated.

    Makes a Cursor of this query, which can be enumerated.

    T

    the results type

    readPreference

    The reactivemongo.api.ReadPreference for this query. If the ReadPreference implies that this query can be run on a secondary, the slaveOk flag will be set.

    reader

    the reader for the results type

  12. def ensuring(cond: (GenericQueryBuilder[P]) ⇒ Boolean, msg: ⇒ Any): GenericQueryBuilder[P]

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to Ensuring[GenericQueryBuilder[P]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: (GenericQueryBuilder[P]) ⇒ Boolean): GenericQueryBuilder[P]

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to Ensuring[GenericQueryBuilder[P]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean, msg: ⇒ Any): GenericQueryBuilder[P]

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to Ensuring[GenericQueryBuilder[P]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean): GenericQueryBuilder[P]

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to Ensuring[GenericQueryBuilder[P]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. def explain(flag: Boolean = true): Self

    Toggles explain mode.

  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. def hint(document: P.Document): Self

    Sets the hint document (a document that declares the index MongoDB should use for this query).

  24. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  25. def maxTimeMs(p: Long): Self

    Adds maxTimeMs to query https://docs.

    Adds maxTimeMs to query https://docs.mongodb.org/v3.0/reference/operator/meta/maxTimeMS/

  26. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  29. def one[T](readPreference: ReadPreference)(implicit reader: P.Reader[T], ec: ExecutionContext): Future[Option[T]]

    Sends this query and gets a future Option[T] (alias for reactivemongo.api.Cursor.headOption).

    Sends this query and gets a future Option[T] (alias for reactivemongo.api.Cursor.headOption).

    T

    the results type

    readPreference

    The reactivemongo.api.ReadPreference for this query. If the ReadPreference implies that this query can be run on a secondary, the slaveOk flag will be set.

    reader

    the reader for the results type

  30. def one[T](implicit reader: P.Reader[T], ec: ExecutionContext): Future[Option[T]]

    Sends this query and gets a future Option[T] (alias for reactivemongo.api.Cursor.headOption).

    Sends this query and gets a future Option[T] (alias for reactivemongo.api.Cursor.headOption).

    T

    the results type

    reader

    the reader for the results type

  31. def options(options: QueryOpts): Self

  32. def projection(p: P.Document): Self

    Sets the projection document (for retrieving only a subset of fields).

  33. def projection[Pjn](p: Pjn)(implicit writer: P.Writer[Pjn]): Self

    Sets the projection document (for retrieving only a subset of fields).

    Sets the projection document (for retrieving only a subset of fields).

    Pjn

    The type of the projection. An implicit Writer[Pjn] typeclass for handling it has to be in the scope.

  34. def query(selector: P.Document): Self

    Sets the query (the selector document).

  35. def query[Qry](selector: Qry)(implicit writer: P.Writer[Qry]): Self

    Sets the selector document.

    Sets the selector document.

    Qry

    The type of the query. An implicit Writer[Qry] typeclass for handling it has to be in the scope.

  36. def requireOne[T](readPreference: ReadPreference)(implicit reader: P.Reader[T], ec: ExecutionContext): Future[T]

    Sends this query and gets a future T (alias for reactivemongo.api.Cursor.head).

    Sends this query and gets a future T (alias for reactivemongo.api.Cursor.head).

    T

    the results type

    readPreference

    The reactivemongo.api.ReadPreference for this query. If the ReadPreference implies that this query can be run on a secondary, the slaveOk flag will be set.

    reader

    the reader for the results type

  37. def requireOne[T](implicit reader: P.Reader[T], ec: ExecutionContext): Future[T]

    Sends this query and gets a future T (alias for reactivemongo.api.Cursor.head).

    Sends this query and gets a future T (alias for reactivemongo.api.Cursor.head).

    T

    the results type

    reader

    the reader for the results type

  38. def snapshot(flag: Boolean = true): Self

    Toggles snapshot mode.

  39. def sort(document: P.Document): Self

    Sets the sorting document.

  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  41. def toString(): String

    Definition Classes
    AnyRef → Any
  42. def updateOptions(update: (QueryOpts) ⇒ QueryOpts): Self

    Returns a builder with the options updated.

  43. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. def [B](y: B): (GenericQueryBuilder[P], B)

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to ArrowAssoc[GenericQueryBuilder[P]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (genericQueryBuilder: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (genericQueryBuilder: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def cursor[T](implicit reader: P.Reader[T], ec: ExecutionContext, cp: CursorProducer[T]): ProducedCursor

    Sends this query and gets a Cursor of instances of T.

    Sends this query and gets a Cursor of instances of T.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.11.0) Use cursor() or cursor(readPreference)

  2. def x: GenericQueryBuilder[P]

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to ArrowAssoc[GenericQueryBuilder[P]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (genericQueryBuilder: ArrowAssoc[GenericQueryBuilder[P]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  3. def x: GenericQueryBuilder[P]

    Implicit information
    This member is added by an implicit conversion from GenericQueryBuilder[P] to Ensuring[GenericQueryBuilder[P]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (genericQueryBuilder: Ensuring[GenericQueryBuilder[P]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from GenericQueryBuilder[P] to StringAdd

Inherited by implicit conversion any2stringfmt from GenericQueryBuilder[P] to StringFormat

Inherited by implicit conversion any2ArrowAssoc from GenericQueryBuilder[P] to ArrowAssoc[GenericQueryBuilder[P]]

Inherited by implicit conversion any2Ensuring from GenericQueryBuilder[P] to Ensuring[GenericQueryBuilder[P]]

Ungrouped