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 any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  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, options: MongoConnectionOptions)

    mongosystem

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

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from MongoConnection to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (MongoConnection, B)

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

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. object MonitorActor

  9. val actorSystem: ActorSystem

  10. 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.

  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. 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.

    checkedWriteRequest

    The request maker.

    returns

    The future response.

  13. def ask(message: RequestMaker, isMongo26WriteOp: Boolean): 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.

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

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

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

    Authenticates the connection on the given database.

  16. def clone(): AnyRef

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

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

  18. 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.

  19. 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 any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: (MongoConnection) ⇒ Boolean): MongoConnection

    Implicit information
    This member is added by an implicit conversion from MongoConnection to Ensuring[MongoConnection] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. 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 any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: Boolean): MongoConnection

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

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

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

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

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

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

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

    Definition Classes
    Any
  30. val mongosystem: ActorRef

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

  31. val monitor: ActorRef

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

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

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

    Definition Classes
    AnyRef
  35. val options: MongoConnectionOptions

  36. 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.

  37. def sendExpectingResponse(requestMaker: RequestMaker, isMongo26WriteOp: Boolean)(implicit ec: ExecutionContext): Future[Response]

  38. def sendExpectingResponse(checkedWriteRequest: CheckedWriteRequest)(implicit ec: ExecutionContext): Future[Response]

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

    Definition Classes
    AnyRef
  40. def toString(): String

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

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

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

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

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

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

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

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from MongoConnection to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (mongoConnection: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from MongoConnection to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (mongoConnection: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: MongoConnection

    Implicit information
    This member is added by an implicit conversion from MongoConnection to ArrowAssoc[MongoConnection] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (mongoConnection: ArrowAssoc[MongoConnection]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: MongoConnection

    Implicit information
    This member is added by an implicit conversion from MongoConnection to Ensuring[MongoConnection] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (mongoConnection: Ensuring[MongoConnection]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from MongoConnection to StringAdd

Inherited by implicit conversion any2stringfmt from MongoConnection to StringFormat

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

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

Ungrouped