Trait

reactivemongo.api.collections

GenericQueryBuilder

Related Doc: package collections

Permalink

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
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GenericQueryBuilder
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

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

    Permalink

Abstract Value Members

  1. abstract def collection: Collection

    Permalink
  2. abstract def commentString: Option[String]

    Permalink
  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

    Permalink
  4. abstract def explainFlag: Boolean

    Permalink
  5. abstract def failover: FailoverStrategy

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

    Permalink
  7. abstract def maxTimeMsOption: Option[Long]

    Permalink
  8. abstract def options: QueryOpts

    Permalink
  9. abstract val pack: P

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

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

    Permalink
  12. abstract def snapshotFlag: Boolean

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

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

    Permalink
    Annotations
    @deprecated
    Deprecated

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

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

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

    Permalink

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

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

    Permalink

    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

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

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

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

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

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

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

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

    Permalink

    Toggles explain mode.

  17. def finalize(): Unit

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

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

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

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

    Permalink

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

  22. final def isInstanceOf[T0]: Boolean

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

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

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

    Permalink

    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

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

    Permalink

    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

  29. def options(options: QueryOpts): Self

    Permalink
  30. def projection(p: P.Document): Self

    Permalink

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

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

    Permalink

    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.

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

    Permalink

    Sets the query (the selector document).

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

    Permalink

    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.

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    Toggles snapshot mode.

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

    Permalink

    Sets the sorting document.

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

    Permalink
    Definition Classes
    AnyRef
  39. def toString(): String

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

    Permalink

    Returns a builder with the options updated.

  41. final def wait(): Unit

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

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

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

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

Deprecated Value Members

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

    Permalink

    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)

Inherited from AnyRef

Inherited from Any

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

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

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

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

Ungrouped