package api
- Alphabetic
- By Inheritance
- api
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
sealed
trait
AuthenticationMode
extends AnyRef
Then mode of authentication against the replica set.
-
trait
Collection
extends AnyRef
A MongoDB Collection, resolved from a reactivemongo.api.DefaultDB.
A MongoDB Collection, resolved from a reactivemongo.api.DefaultDB.
You should consider the generic API (reactivemongo.api.collections.GenericCollection) and the default reactivemongo.api.collections.bson.BSONCollection.
-
trait
CollectionMetaCommands
extends AnyRef
A mixin that provides commands about this Collection itself.
-
trait
CollectionProducer
[+C <: Collection] extends AnyRef
A Producer of Collection implementation.
A Producer of Collection implementation.
This is used to get an implementation implicitly when getting a reference of a Collection.
-
trait
Cursor
[T] extends AnyRef
Cursor over results from MongoDB.
Cursor over results from MongoDB.
- T
the type parsed from each result document
-
trait
CursorFlattener
[C[_] <: Cursor[_]] extends AnyRef
Flattening strategy for cursor.
Flattening strategy for cursor.
trait FooCursor[T] extends Cursor[T] { def foo: String } implicit def fooFlattener[T] = new CursorFlattener[FooCursor] { def flatten[T](future: Future[FooCursor[T]]): FooCursor[T] = new FlattenedCursor[T](future) with FooCursor[T] { def foo = "Flattened" } }
-
sealed
trait
CursorOps
[T] extends AnyRef
Internal cursor operations.
-
trait
CursorProducer
[T] extends AnyRef
Allows to enrich a base cursor.
-
sealed
trait
DB
extends AnyRef
The reference to a MongoDB database, obtained from a reactivemongo.api.MongoConnection.
The reference to a MongoDB database, obtained from a reactivemongo.api.MongoConnection.
You should consider the provided reactivemongo.api.DefaultDB implementation.
import reactivemongo.api._ val connection = MongoConnection(List("localhost:27017")) val db = connection.database("plugin") val collection = db.map(_("acoll"))
-
trait
DBMetaCommands
extends AnyRef
A mixin that provides commands about this database itself.
-
case class
DefaultDB
(name: String, connection: MongoConnection, failoverStrategy: FailoverStrategy = FailoverStrategy()) extends DB with DBMetaCommands with GenericDB[BSONSerializationPack.type] with Product with Serializable
The default DB implementation, that mixes in the database traits.
The default DB implementation, that mixes in the database traits.
- Annotations
- @SerialVersionUID()
-
class
Failover
[T] extends AnyRef
A helper that sends the given message to the given actor, following a failover strategy.
A helper that sends the given message to the given actor, following a failover strategy. This helper holds a future reference that is completed with a response, after 1 or more attempts (specified in the given strategy). If the all the tryouts configured by the given strategy were unsuccessful, the future reference is completed with a Throwable.
Should not be used directly for most use cases.
- T
Type of the message to send.
-
case class
FailoverStrategy
(initialDelay: FiniteDuration = FiniteDuration(100, "ms"), retries: Int = 10, delayFactor: (Int) ⇒ Double = FailoverStrategy.defaultFactor) extends Product with Serializable
A failover strategy for sending requests.
A failover strategy for sending requests. The default uses 10 retries: 125ms, 250ms, 375ms, 500ms, 625ms, 750ms, 875ms, 1s, 1125ms, 1250ms
- initialDelay
the initial delay between the first failed attempt and the next one.
- retries
the number of retries to do before giving up.
- delayFactor
a function that takes the current iteration and returns a factor to be applied to the initialDelay (default: FailoverStrategy.defaultFactor)
- class FlattenedCursor [T] extends Cursor[T]
-
class
MongoConnection
extends AnyRef
A pool of MongoDB connections, obtained from a reactivemongo.api.MongoDriver.
A pool of MongoDB connections, obtained from a reactivemongo.api.MongoDriver.
Connection here does not mean that there is one open channel to the server: behind the scene, many connections (channels) are open on all the available servers in the replica set.
Example:
import reactivemongo.api._ val connection = MongoConnection(List("localhost")) val db = connection.database("plugin") val collection = db.map(_.("acoll"))
-
case class
MongoConnectionOptions
(connectTimeoutMS: Int = 0, authSource: Option[String] = None, sslEnabled: Boolean = false, sslAllowsInvalidCert: Boolean = false, authMode: AuthenticationMode = ScramSha1Authentication, tcpNoDelay: Boolean = false, keepAlive: Boolean = false, nbChannelsPerNode: Int = 10, writeConcern: WriteConcern = WriteConcern.Default, readPreference: ReadPreference = ReadPreference.primary, failoverStrategy: FailoverStrategy = FailoverStrategy.default, monitorRefreshMS: Int = 10000, maxIdleTimeMS: Int = 0) extends Product with Serializable
Options for MongoConnection.
Options for MongoConnection.
- connectTimeoutMS
The number of milliseconds to wait for a connection to be established before giving up.
- authSource
The database source for authentication credentials.
- sslEnabled
Enable SSL connection (required to be accepted on server-side).
- sslAllowsInvalidCert
If
sslEnabled
is true, this one indicates whether to accept invalid certificates (e.g. self-signed).- authMode
Either CrAuthentication or ScramSha1Authentication
- tcpNoDelay
TCPNoDelay flag (ReactiveMongo-specific option). The default value is false (see TCP_NODELAY).
- keepAlive
TCP KeepAlive flag (ReactiveMongo-specific option). The default value is false (see SO_KEEPALIVE).
- nbChannelsPerNode
Number of channels (connections) per node (ReactiveMongo-specific option).
- writeConcern
the default write concern
- readPreference
the default read preference
- failoverStrategy
the default failover strategy
- monitorRefreshMS
the interval in milliseconds used by monitor to refresh the node set (default: 10000 aka 10s)
- maxIdleTimeMS
the maximum number of milliseconds that a channel can remain idle in the connection pool before being removed and closed (default: 0 to disable, as implemented using Netty IdleStateHandler); If not 0, must be greater or equal to #monitorRefreshMS
- class MongoDriver extends AnyRef
-
case class
QueryOpts
(skipN: Int = 0, batchSizeN: Int = 0, flagsN: Int = 0) extends Product with Serializable
A helper to make the query options.
A helper to make the query options. You may use the methods to set the fields of this class, or set them directly.
- skipN
the number of documents to skip.
- batchSizeN
the upper limit on the number of documents to retrieve per batch.
- flagsN
the query flags
- sealed trait ReadConcern extends AnyRef
-
sealed
trait
ReadPreference
extends AnyRef
MongoDB Read Preferences enable to read from primary or secondaries with a predefined strategy.
- trait SerializationPack extends AnyRef
- type SerializationPackObject = SerializationPack with Singleton
-
trait
WrappedCursor
[T] extends Cursor[T]
Cursor wrapper, to help to define custom cursor classes.
Cursor wrapper, to help to define custom cursor classes.
- See also
CursorProducer
-
class
Failover2
[A] extends AnyRef
- Annotations
- @deprecated
- Deprecated
(Since version 0.11.11) Will be made private
-
trait
GenericDB
[P <: SerializationPack with Singleton] extends AnyRef
- Annotations
- @deprecated
- Deprecated
(Since version 0.12-RC0) Will be made sealed
-
sealed
trait
SortOrder
extends AnyRef
- Annotations
- @deprecated
- Deprecated
(Since version 0.11.10) Will be removed
Value Members
-
object
BSONSerializationPack
extends SerializationPack
The default serialization pack.
-
object
CrAuthentication
extends AuthenticationMode with Product with Serializable
MongoDB-CR authentication
-
object
Cursor
Cursor companion object
-
object
CursorFlattener
Flatteners helper
- object CursorOps
- object CursorProducer
- object DB
- object DefaultCursor
- object Failover2
- object FailoverStrategy extends Serializable
- object MongoConnection
- object MongoConnectionOptions extends Serializable
-
object
MongoDriver
The driver factory
- object ReadConcern
- object ReadPreference
-
object
ScramSha1Authentication
extends AuthenticationMode with Product with Serializable
SCRAM-SHA-1 authentication (see MongoDB 3.0)
- object Version