reactivemongo.api

MongoConnection

Related Docs: object MongoConnection | package api

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, 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. object MonitorActor

  7. val actorSystem: ActorSystem

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

  9. final def asInstanceOf[T0]: T0

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

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

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

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

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

    Authenticates the connection on the given database.

  14. def clone(): AnyRef

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

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

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

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. 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()
  25. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  28. val mongosystem: ActorRef

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

  29. val monitor: ActorRef

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

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

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

    Definition Classes
    AnyRef
  33. val options: MongoConnectionOptions

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

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

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

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

    Definition Classes
    AnyRef
  38. def toString(): String

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

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

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

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

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

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