object AcolyteDSL extends WithDriver with WithDB with WithCollection with WithHandler with WithResult

Acolyte DSL for ReactiveMongo.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AcolyteDSL
  2. WithResult
  3. WithHandler
  4. WithCollection
  5. WithDB
  6. WithDriver
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def driver(cl: ClassLoader)(implicit m: DriverManager): AsyncDriver

    Returns unmanaged driver.

    Returns unmanaged driver. You will have to close it by yourself.

    Definition Classes
    WithDriver
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def handle: ConnectionHandler

    Creates an empty connection handler.

    Creates an empty connection handler.

    import acolyte.reactivemongo.AcolyteDSL
    
    def foo = AcolyteDSL.handle
    See also

    withDriver

  12. def handleQuery[T](handler: T)(implicit f: (T) => QueryHandler): ConnectionHandler

    Creates a connection handler with given query handler, but no write handler.

    Creates a connection handler with given query handler, but no write handler.

    import scala.concurrent.ExecutionContext
    
    import acolyte.reactivemongo.AcolyteDSL.{
      withConnection, withDriver, handleQuery
    }
    import acolyte.reactivemongo.{ PreparedResponse, Request }
    
    def aResponse: PreparedResponse = ???
    
    def foo(implicit ec: ExecutionContext) =
      withDriver { implicit d =>
        withConnection(handleQuery { (_: Request) => aResponse }) { _ =>
          // work with connection (e.g. call you function using Mongo)
          "Value"
        }
      }
    See also

    ConnectionHandler.withWriteHandler

  13. def handleWrite[T](handler: T)(implicit f: (T) => WriteHandler): ConnectionHandler

    Creates a connection handler with given write handler, but no query handler.

    Creates a connection handler with given write handler, but no query handler.

    import scala.concurrent.ExecutionContext
    import reactivemongo.api.AsyncDriver
    
    import acolyte.reactivemongo.AcolyteDSL.{
      withConnection, withDriver, handleWrite
    }
    import acolyte.reactivemongo.{ Request, WriteOp, PreparedResponse }
    
    def aResponse: PreparedResponse = ???
    
    def foo(implicit ec: ExecutionContext) =
      withDriver { implicit d: AsyncDriver =>
        withConnection(handleWrite {
          (_: WriteOp, _: Request) => aResponse }) { _ =>
          // work with connection (e.g. call you function using Mongo)
          "Value"
        }
      }
    See also

    ConnectionHandler.withQueryHandler

  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. def withCollection[T](db: DB, name: String)(f: (BSONCollection) => T): T

    Works with specified collection from MongoDB "acolyte" resolved using given Mongo DB.

    Works with specified collection from MongoDB "acolyte" resolved using given Mongo DB.

    db

    Previously resolved Mongo DB

    name

    the name of the collection

    f

    Function applied to resolved Mongo collection

    import scala.concurrent.{ ExecutionContext, Future }
    import reactivemongo.api.AsyncDriver
    import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler }
    
    def s(handler: ConnectionHandler)(
      implicit ec: ExecutionContext, d: AsyncDriver): Future[String] =
      AcolyteDSL.withDB(handler) { db =>
        AcolyteDSL.withCollection(db, "colName") { _ =>
          "Result"
        }
      }
    Definition Classes
    WithCollection
  25. def withCollection[T](con: => MongoConnection, name: String)(f: (BSONCollection) => T)(implicit ec: ExecutionContext, compose: ComposeWithCompletion[T]): Outer

    Works with specified collection from MongoDB "acolyte" resolved using given connection.

    Works with specified collection from MongoDB "acolyte" resolved using given connection.

    con

    Previously initialized connection

    name

    the name of the collection

    f

    Function applied to resolved Mongo collection

    import scala.concurrent.{ ExecutionContext, Future }
    import reactivemongo.api.AsyncDriver
    import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler }
    
    // handler: ConnectionHandler
    def s(handler: ConnectionHandler)(
      implicit ec: ExecutionContext, d: AsyncDriver): Future[String] =
      AcolyteDSL.withConnection(handler) { con =>
        AcolyteDSL.withCollection(con, "colName") { _ =>
          "Result"
        }
      }
    Definition Classes
    WithCollection
    See also

    WithDriver.withDB[T]

  26. def withCollection[A, B](conParam: => A, name: String)(f: (BSONCollection) => B)(implicit d: AsyncDriver, m: ConnectionManager[A], ec: ExecutionContext, compose: ComposeWithCompletion[B]): Outer

    Works with specified collection from MongoDB "acolyte" resolved using given driver initialized with Acolyte for ReactiveMongo (should not be used with other driver instances).

    Works with specified collection from MongoDB "acolyte" resolved using given driver initialized with Acolyte for ReactiveMongo (should not be used with other driver instances). Driver and associated resources are released after the function f the result Future is completed.

    conParam

    Connection manager parameter (see ConnectionManager)

    name

    the name of the collection

    f

    Function applied to resolved Mongo collection

    import scala.concurrent.{ ExecutionContext, Future }
    import reactivemongo.api.AsyncDriver
    import acolyte.reactivemongo.{ AcolyteDSL, ConnectionManager }
    
    // handler: ConnectionHandler
    def s[T: ConnectionManager](handler: => T)(
      implicit ec: ExecutionContext, d: AsyncDriver): Future[String] =
      AcolyteDSL.withCollection(handler, "colName") { _ =>
        "Result"
      }
    Definition Classes
    WithCollection
    See also

    AcolyteDSL.withDB[A,B]

  27. def withConnection[A, B](conParam: => A)(f: (MongoConnection) => B)(implicit d: AsyncDriver, m: ConnectionManager[A], ec: ExecutionContext, compose: ComposeWithCompletion[B]): Outer

    Works with connection with options appropriate for a driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).

    Works with connection with options appropriate for a driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances). Connection is closed after the result Future is completed.

    conParam

    Connection manager parameter (see ConnectionManager)

    f

    the function applied to initialized Mongo DB

    import scala.concurrent.{ ExecutionContext, Future }
    
    import reactivemongo.api.{ MongoConnection, AsyncDriver }
    import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler }
    
    // handler: ConnectionHandler
    def s(handler: ConnectionHandler)(
      implicit ec: ExecutionContext, d: AsyncDriver): Future[String] =
      AcolyteDSL.withConnection(handler) { (_: MongoConnection) =>
        "Result"
      }
    Definition Classes
    WithDriver
  28. def withDB[T](con: => MongoConnection, name: String)(f: (DB) => T)(implicit ec: ExecutionContext, compose: ComposeWithCompletion[T]): Outer

    Works with a Mongo database resolved using given driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).

    Works with a Mongo database resolved using given driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).

    con

    a previously initialized connection

    name

    the name of the collection

    f

    the function applied to initialized Mongo DB

    import scala.concurrent.{ ExecutionContext, Future }
    
    import reactivemongo.api.{ DB, AsyncDriver }
    import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler }
    
    // handler: ConnectionHandler
    def s(handler: ConnectionHandler)(
      implicit ec: ExecutionContext, d: AsyncDriver): Future[String] =
      AcolyteDSL.withConnection(handler) { con =>
        AcolyteDSL.withDB(con, "my_db") { (_: DB) =>
          "Result"
        }
      }
    Definition Classes
    WithDB
    See also

    AcolyteDSL.withConnection

  29. def withDB[T](con: => MongoConnection)(f: (DB) => T)(implicit ec: ExecutionContext, compose: ComposeWithCompletion[T]): Outer

    Works with Mongo database (named "acolyte") resolved using given driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).

    Works with Mongo database (named "acolyte") resolved using given driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).

    con

    a previously initialized connection

    f

    the function applied to initialized Mongo DB

    import scala.concurrent.ExecutionContext
    
    import reactivemongo.api.{ DB, AsyncDriver }
    import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler }
    
    def s(handler: ConnectionHandler)(
      implicit ec: ExecutionContext, d: AsyncDriver) =
      AcolyteDSL.withConnection(handler) { con =>
        AcolyteDSL.withDB(con) { (_: DB) =>
          "Result"
        }
      }
    Definition Classes
    WithDB
    See also

    AcolyteDSL.withConnection

  30. def withDB[A, B](conParam: => A, name: String, setName: Option[String] = None)(f: (DB) => B)(implicit d: AsyncDriver, m: ConnectionManager[A], ec: ExecutionContext, compose: ComposeWithCompletion[B]): Outer

    Works with a Mongo database resolved using given driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).

    Works with a Mongo database resolved using given driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances). Driver and associated resources are released after the function f the result Future is completed.

    conParam

    Connection manager parameter (see ConnectionManager)

    name

    the name of the collection

    setName

    the name of the replica set (if some)

    f

    the function applied to initialized Mongo DB

    import scala.concurrent.{ ExecutionContext, Future }
    
    import reactivemongo.api.{ DB, AsyncDriver }
    import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler }
    
    def s(handler: ConnectionHandler)(
      implicit ec: ExecutionContext, d: AsyncDriver): Future[String] =
      AcolyteDSL.withDB(handler, "my_db") { (_: DB) =>
        "Result"
      }
    Definition Classes
    WithDB
    See also

    AcolyteDSL.withConnection

  31. def withDB[A, B](conParam: => A)(f: (DB) => B)(implicit d: AsyncDriver, m: ConnectionManager[A], ec: ExecutionContext, compose: ComposeWithCompletion[B]): Outer

    Works with a Mongo database (named "acolyte") resolved using given driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).

    Works with a Mongo database (named "acolyte") resolved using given driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances). Driver and associated resources are released after the function f the result Future is completed.

    conParam

    Connection manager parameter (see ConnectionManager)

    f

    the function applied to initialized Mongo DB

    import scala.concurrent.{ ExecutionContext, Future }
    
    import reactivemongo.api.{ DB, AsyncDriver }
    import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler }
    
    def s(handler: ConnectionHandler)(
      implicit ec: ExecutionContext, d: AsyncDriver): Future[String] =
      AcolyteDSL.withDB(handler) { (_: DB) =>
        "Result"
      }
    Definition Classes
    WithDB
    See also

    AcolyteDSL.withConnection

  32. def withDriver[T](f: (AsyncDriver) => T)(implicit m: DriverManager, ec: ExecutionContext, compose: ComposeWithCompletion[T]): Outer

    Works with MongoDB driver configured with Acolyte handlers.

    Works with MongoDB driver configured with Acolyte handlers. Driver and associated resources are released after the function f the result Future is completed.

    f

    the function applied to initialized Mongo DB

    import scala.concurrent.{ ExecutionContext, Future }
    import reactivemongo.api.AsyncDriver
    import acolyte.reactivemongo.AcolyteDSL
    
    // handler: ConnectionHandler
    def s(implicit ec: ExecutionContext): Future[String] =
      AcolyteDSL.withDriver { (_: AsyncDriver) =>
        "Result"
      }
    Definition Classes
    WithDriver
  33. def withQueryHandler[T](handler: (Request) => PreparedResponse)(f: (MongoConnection) => T)(implicit d: AsyncDriver, m: ConnectionManager[ConnectionHandler], ec: ExecutionContext, compose: ComposeWithCompletion[T]): Outer

    Works with a MongoDB driver handling only queries, using given query handler.

    Works with a MongoDB driver handling only queries, using given query handler. Driver and associated resources are released after the function f the result Future is completed.

    handler

    Query handler

    import scala.concurrent.ExecutionContext
    
    import reactivemongo.api.{ AsyncDriver, MongoConnection }
    import acolyte.reactivemongo.{ AcolyteDSL, PreparedResponse, Request }
    
    def aResponse: PreparedResponse = ???
    
    def foo(implicit ec: ExecutionContext, d: AsyncDriver) =
      AcolyteDSL.withQueryHandler({ (_: Request) => aResponse }) {
        (_: MongoConnection) => "aResult"
      }
    Definition Classes
    WithHandler
    See also

    AcolyteDSL.withDriver

    AcolyteDSL.handleQuery

    AcolyteDSL.withQueryResult

  34. def withQueryResult[A, B](result: => A)(f: (MongoConnection) => B)(implicit d: AsyncDriver, m: ConnectionManager[ConnectionHandler], mk: QueryResponseMaker[A], ec: ExecutionContext, compose: ComposeWithCompletion[B]): Outer

    Works with a MongoDB driver handling only queries, and returning given result for all of them.

    Works with a MongoDB driver handling only queries, and returning given result for all of them. Driver and associated resources are released after the function f the result Future is completed.

    result

    Query result

    Definition Classes
    WithResult
    See also

    AcolyteDSL.withDriver

    AcolyteDSL.handleQuery

  35. def withWriteHandler[T](handler: (WriteOp, Request) => PreparedResponse)(f: (MongoConnection) => T)(implicit d: AsyncDriver, m: ConnectionManager[ConnectionHandler], ec: ExecutionContext, compose: ComposeWithCompletion[T]): Outer

    Works with a MongoDB driver handling only write operations, using given write handler.

    Works with a MongoDB driver handling only write operations, using given write handler. Driver and associated resources are released after the function f the result Future is completed.

    handler

    Writer handler

    import scala.concurrent.ExecutionContext
    
    import reactivemongo.api.AsyncDriver
    import acolyte.reactivemongo.{
      AcolyteDSL, PreparedResponse, Request, WriteOp
    }
    
    def aResp: PreparedResponse = ???
    
    def foo(implicit ec: ExecutionContext, d: AsyncDriver) =
      AcolyteDSL.withWriteHandler({ (_: WriteOp, _: Request) => aResp }) { _ =>
        "aResult"
      }
    Definition Classes
    WithHandler
    See also

    AcolyteDSL.withDriver

    AcolyteDSL.handleWrite

    AcolyteDSL.withWriteResult

  36. def withWriteResult[A, B](result: => A)(f: (MongoConnection) => B)(implicit d: AsyncDriver, m: ConnectionManager[ConnectionHandler], mk: WriteResponseMaker[A], ec: ExecutionContext, compose: ComposeWithCompletion[B]): Outer

    Works with a MongoDB driver handling only write operations, and returning given result for all of them.

    Works with a MongoDB driver handling only write operations, and returning given result for all of them. Driver and associated resources are released after the function f the result Future is completed.

    Definition Classes
    WithResult
    See also

    AcolyteDSL.withDriver

    AcolyteDSL.handleWrite

    AcolyteDSL.withWriteHandler

Inherited from WithResult

Inherited from WithHandler

Inherited from WithCollection

Inherited from WithDB

Inherited from WithDriver

Inherited from AnyRef

Inherited from Any

Ungrouped