class MongoConnection extends AnyRef

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"))
Linear Supertypes
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)

    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.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from MongoConnection toany2stringadd[MongoConnection] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (MongoConnection, B)
    Implicit
    This member is added by an implicit conversion from MongoConnection toArrowAssoc[MongoConnection] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def active: Boolean

    Returns true if the connection has not been killed.

    Returns true if the connection has not been killed.

    Annotations
    @inline()
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def askClose()(implicit timeout: FiniteDuration): Future[_]

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

  9. def authenticate(db: String, user: String, password: String, failoverStrategy: FailoverStrategy = options.failoverStrategy)(implicit ec: ExecutionContext): Future[SuccessfulAuthentication]

    Authenticates the connection on the given database.

    Authenticates the connection on the given database.

    db

    the database name

    user

    the user name

    password

    the user password

    failoverStrategy

    the failover strategy for sending requests

  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  11. def database(name: String, failoverStrategy: FailoverStrategy = options.failoverStrategy)(implicit ec: ExecutionContext): Future[DefaultDB]

    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

  12. def ensuring(cond: (MongoConnection) => Boolean, msg: => Any): MongoConnection
    Implicit
    This member is added by an implicit conversion from MongoConnection toEnsuring[MongoConnection] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: (MongoConnection) => Boolean): MongoConnection
    Implicit
    This member is added by an implicit conversion from MongoConnection toEnsuring[MongoConnection] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean, msg: => Any): MongoConnection
    Implicit
    This member is added by an implicit conversion from MongoConnection toEnsuring[MongoConnection] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean): MongoConnection
    Implicit
    This member is added by an implicit conversion from MongoConnection toEnsuring[MongoConnection] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  19. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from MongoConnection toStringFormat[MongoConnection] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. val actorSystem: ActorSystem
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14.0) Internal: will be made private

  2. def authenticate(db: String, user: String, password: String): Future[SuccessfulAuthentication]
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14.0) Use authenticate with failoverStrategy

  3. val mongosystem: ActorRef
    Annotations
    @deprecated
    Deprecated

    (Since version 0.17.0) Internal: will be made private

  4. val name: String
    Annotations
    @deprecated
    Deprecated

    (Since version 0.17.0) Internal: will be made private

  5. val options: MongoConnectionOptions
    Annotations
    @deprecated
    Deprecated

    (Since version 0.17.0) Internal: will be made private

  6. val supervisor: String
    Annotations
    @deprecated
    Deprecated

    (Since version 0.17.0) Internal: will be made private

  7. def [B](y: B): (MongoConnection, B)
    Implicit
    This member is added by an implicit conversion from MongoConnection toArrowAssoc[MongoConnection] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromMongoConnection to any2stringadd[MongoConnection]

Inherited by implicit conversion StringFormat fromMongoConnection to StringFormat[MongoConnection]

Inherited by implicit conversion Ensuring fromMongoConnection to Ensuring[MongoConnection]

Inherited by implicit conversion ArrowAssoc fromMongoConnection to ArrowAssoc[MongoConnection]

Ungrouped