trait GenericQueryBuilder[P <: SerializationPack] extends QueryOps
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.
- Annotations
- @deprecated
- Deprecated
(Since version 0.16.0) Internal: will be made private
- Alphabetic
- By Inheritance
- GenericQueryBuilder
- QueryOps
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
-
abstract
type
Self <: GenericQueryBuilder[pack.type]
- Definition Classes
- GenericQueryBuilder → QueryOps
Abstract Value Members
- abstract def collection: Collection
- abstract def commentString: Option[String]
- abstract def explainFlag: Boolean
-
abstract
def
failoverStrategy: FailoverStrategy
- Annotations
- @deprecatedName( 'failover , ... )
- abstract def hintOption: Option[P.Document]
- abstract def maxTimeMsOption: Option[Long]
- abstract def options: QueryOpts
- abstract val pack: P
- abstract def projectionOption: Option[P.Document]
- abstract def queryOption: Option[P.Document]
- abstract def snapshotFlag: Boolean
- abstract def sortOption: Option[P.Document]
-
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, failoverStrategy: FailoverStrategy = failoverStrategy, maxTimeMsOption: Option[Long] = maxTimeMsOption): Self
- Annotations
- @deprecated
- Deprecated
(Since version 0.16.0) Internal: will be made private
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- 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
-
def
->[B](y: B): (GenericQueryBuilder[P], B)
- Implicit
- 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()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
awaitData: Self
Toggles AwaitData: Block a little while waiting for more data instead of returning immediately if no data.
Toggles AwaitData: Block a little while waiting for more data instead of returning immediately if no data. Use along with TailableCursor.
- Definition Classes
- GenericQueryBuilder → QueryOps
-
def
batchSize(n: Int): Self
Sets an upper limit on the number of documents to retrieve per batch.
Sets an upper limit on the number of documents to retrieve per batch. Defaults to 0 (meaning no upper limit - MongoDB decides).
- Definition Classes
- GenericQueryBuilder → QueryOps
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
comment(message: String): Self
Adds a comment to this query, that may appear in the MongoDB logs.
-
def
cursor[T](readPreference: ReadPreference = readPreference, isMongo26WriteOp: Boolean = false)(implicit reader: P.Reader[T], 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
ReadPreferenceimplies that this query can be run on a secondary, the slaveOk flag will be set.- reader
the reader for the results type
-
def
ensuring(cond: (GenericQueryBuilder[P]) ⇒ Boolean, msg: ⇒ Any): GenericQueryBuilder[P]
- Implicit
- 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
-
def
ensuring(cond: (GenericQueryBuilder[P]) ⇒ Boolean): GenericQueryBuilder[P]
- Implicit
- 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
-
def
ensuring(cond: Boolean, msg: ⇒ Any): GenericQueryBuilder[P]
- Implicit
- 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
-
def
ensuring(cond: Boolean): GenericQueryBuilder[P]
- Implicit
- 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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exhaust: Self
Toggles Exhaust
Toggles Exhaust
- Definition Classes
- GenericQueryBuilder → QueryOps
-
def
explain(flag: Boolean = true): Self
Toggles explain mode.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- 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()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hint(document: P.Document): Self
Sets the hint document (a document that declares the index MongoDB should use for this query).
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
maxTimeMs(p: Long): Self
Adds maxTimeMs to query https://docs.mongodb.org/v3.0/reference/operator/meta/maxTimeMS/
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
noCursorTimeout: Self
Toggles NoCursorTimeout: The cursor will not expire automatically
Toggles NoCursorTimeout: The cursor will not expire automatically
- Definition Classes
- GenericQueryBuilder → QueryOps
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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
ReadPreferenceimplies that this query can be run on a secondary, the slaveOk flag will be set.- reader
the reader for the results type
-
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
-
def
oplogReplay: Self
Toggles OplogReplay
Toggles OplogReplay
- Definition Classes
- GenericQueryBuilder → QueryOps
- def options(options: QueryOpts): Self
-
def
partial: Self
Toggles Partial: The response can be partial - if a shard is down, no error will be thrown.
Toggles Partial: The response can be partial - if a shard is down, no error will be thrown.
- Definition Classes
- GenericQueryBuilder → QueryOps
-
def
projection(p: P.Document): Self
Sets the projection document (for retrieving only a subset of fields).
-
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.
-
def
query(selector: P.Document): Self
Sets the query (the selector document).
-
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.
-
def
readConcern: ReadConcern
The read concern (since 3.2)
-
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
ReadPreferenceimplies that this query can be run on a secondary, the slaveOk flag will be set.- reader
the reader for the results type
-
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
-
def
skip(n: Int): Self
Sets the number of documents to skip.
Sets the number of documents to skip.
- Definition Classes
- GenericQueryBuilder → QueryOps
-
def
slaveOk: Self
Toggles SlaveOk: The query is might be run on a secondary.
Toggles SlaveOk: The query is might be run on a secondary.
- Definition Classes
- GenericQueryBuilder → QueryOps
-
def
snapshot(flag: Boolean = true): Self
Toggles snapshot mode.
-
def
sort(document: P.Document): Self
Sets the sorting document.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tailable: Self
Toggles TailableCursor: Makes the cursor not to close after all the data is consumed.
Toggles TailableCursor: Makes the cursor not to close after all the data is consumed.
- Definition Classes
- GenericQueryBuilder → QueryOps
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
lazy val
version: MongoWireVersion
- Attributes
- protected
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
→[B](y: B): (GenericQueryBuilder[P], B)
- Implicit
- 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
-
def
readPreference: ReadPreference
The default ReadPreference
The default ReadPreference
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 0.16.0) Internal: will be made private
-
def
updateOptions(update: (QueryOpts) ⇒ QueryOpts): Self
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.4) Use
optionsor the separate query ops