Class/Object

reactivemongo.api

MongoConnection

Related Docs: object MongoConnection | package api

Permalink

class MongoConnection extends AnyRef

A pool of MongoDB connections.

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"))
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MongoConnection
  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

Instance Constructors

  1. new MongoConnection(supervisor: String, name: String, actorSystem: ActorSystem, mongosystem: ActorRef, options: MongoConnectionOptions)

    Permalink

    supervisor

    the name of the supervisor

    name

    the unique name for the connection pool

    mongosystem

    the reference to the internal reactivemongo.core.actors.MongoDBSystem Actor.

  2. new MongoConnection(actorSys: ActorSystem, mongoSys: ActorRef, opts: MongoConnectionOptions)

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11.14) Create with an explicit supervisor and connection names

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 MongoConnection to any2stringadd[MongoConnection] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (MongoConnection, B)

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

    Permalink
    Definition Classes
    AnyRef → Any
  6. object MonitorActor

    Permalink
  7. val actorSystem: ActorSystem

    Permalink
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def askClose()(implicit timeout: FiniteDuration): Future[_]

    Permalink

    Closes this MongoConnection (closes all the channels and ends the actors).

  10. def authenticate(db: String, user: String, password: String): Future[SuccessfulAuthentication]

    Permalink

    Authenticates the connection on the given database.

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def close(): Unit

    Permalink

    Closes this MongoConnection (closes all the channels and ends the actors)

  13. def database(name: String, failoverStrategy: FailoverStrategy = options.failoverStrategy)(implicit context: ExecutionContext): Future[DefaultDB]

    Permalink

    Returns a DefaultDB reference using this connection.

    Returns a DefaultDB reference using this connection. The failover strategy is also used to wait for the node set to be ready, before returning an available DB.

    name

    the database name

    failoverStrategy

    the failover strategy for sending requests.

  14. def ensuring(cond: (MongoConnection) ⇒ Boolean, msg: ⇒ Any): MongoConnection

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. val mongosystem: ActorRef

    Permalink

    the reference to the internal reactivemongo.core.actors.MongoDBSystem Actor.

  26. val name: String

    Permalink

    the unique name for the connection pool

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

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

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

    Permalink
    Definition Classes
    AnyRef
  30. val options: MongoConnectionOptions

    Permalink
  31. val supervisor: String

    Permalink

    the name of the supervisor

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  34. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. def [B](y: B): (MongoConnection, B)

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

Deprecated Value Members

  1. def apply(name: String, failoverStrategy: FailoverStrategy = options.failoverStrategy)(implicit context: ExecutionContext): DefaultDB

    Permalink

    Returns a DefaultDB reference using this connection.

    Returns a DefaultDB reference using this connection.

    name

    the database name

    failoverStrategy

    the failover strategy for sending requests.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.11.8) Use database

  2. def db(name: String, failoverStrategy: FailoverStrategy = options.failoverStrategy)(implicit context: ExecutionContext): DefaultDB

    Permalink

    Returns a DefaultDB reference using this connection (alias for the apply method).

    Returns a DefaultDB reference using this connection (alias for the apply method).

    name

    the database name

    failoverStrategy

    the failover strategy for sending requests.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.11.8) Must use apply

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from MongoConnection to any2stringadd[MongoConnection]

Inherited by implicit conversion StringFormat from MongoConnection to StringFormat[MongoConnection]

Inherited by implicit conversion Ensuring from MongoConnection to Ensuring[MongoConnection]

Inherited by implicit conversion ArrowAssoc from MongoConnection to ArrowAssoc[MongoConnection]

Ungrouped