reactivemongo.api

MongoConnection

class MongoConnection extends AnyRef

A Mongo Connection.

This is a wrapper around a reference to a reactivemongo.core.actors.MongoDBSystem Actor. 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("plugin")
val collection = db("acoll")

// more explicit way
val db2 = connection.db("plugin")
val collection2 = db2.collection("plugin")
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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MongoConnection(actorSystem: ActorSystem, mongosystem: ActorRef, monitor: ActorRef, options: MongoConnectionOptions)

    mongosystem

    A reference to a 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 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)

    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

    Definition Classes
    AnyRef → Any
  6. val actorSystem: ActorSystem

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

    Returns a DefaultDB reference using this connection.

    Returns a DefaultDB reference using this connection.

    name

    The database name.

    failoverStrategy

    a failover strategy for sending requests.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def ask(checkedWriteRequest: CheckedWriteRequest): Future[Response]

    Writes a checked write request and wait for a response.

    Writes a checked write request and wait for a response.

    returns

    The future response.

  10. def ask(message: RequestMaker): Future[Response]

    Writes a request and wait for a response.

    Writes a request and wait for a response.

    message

    The request maker.

    returns

    The future response.

  11. def askClose()(implicit timeout: FiniteDuration): Future[_]

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

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

    Authenticates the connection on the given database.

  13. def clone(): AnyRef

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

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

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

    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

    a failover strategy for sending requests.

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

    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: (MongoConnection) ⇒ Boolean): MongoConnection

    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. def ensuring(cond: Boolean, msg: ⇒ Any): MongoConnection

    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
  19. def ensuring(cond: Boolean): MongoConnection

    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
  20. final def eq(arg0: AnyRef): Boolean

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

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

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

    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()
  24. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  27. val mongosystem: ActorRef

    A reference to a reactivemongo.core.actors.MongoDBSystem Actor.

  28. val monitor: ActorRef

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

    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  32. val options: MongoConnectionOptions

  33. def send(message: RequestMaker): Unit

    Writes a request and drop the response if any.

    Writes a request and drop the response if any.

    message

    The request maker.

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

    Definition Classes
    AnyRef
  35. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. def waitForPrimary(implicit waitForAvailability: FiniteDuration): Future[_]

    Get a future that will be successful when a primary node is available or times out.

  40. def [B](y: B): (MongoConnection, B)

    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

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