Object

acolyte.reactivemongo

AcolyteDSL

Related Doc: package reactivemongo

Permalink

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

Acolyte DSL for ReactiveMongo.

Linear Supertypes
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. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def driver(implicit m: DriverManager): MongoDriver

    Permalink

    Returns unmanaged driver.

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

    Definition Classes
    WithDriver
  7. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def handle: ConnectionHandler

    Permalink

    Creates an empty connection handler.

    Creates an empty connection handler.

    import reactivemongo.api.MongoDriver
    import acolyte.reactivemongo.AcolyteDSL.{ withDriver, handle }
    
    withDriver(handle) { d =>
      val driver: MongoDriver = d // configured with empty handler
      // work with driver (e.g. call you function using Mongo)
      "Value"
    }
    See also

    withDriver

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

    Permalink

    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 reactivemongo.api.MongoDriver
    import acolyte.reactivemongo.AcolyteDSL.{ withDriver, handleQuery }
    import acolyte.reactivemongo.Request
    
    withDriver(handleQuery { req: Request => aResponse }) { d =>
      val driver: MongoDriver = d // configured with given handler
      // work with driver (e.g. call you function using Mongo)
      "Value"
    }
    See also

    ConnectionHandler.withWriteHandler

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

    Permalink

    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 reactivemongo.api.MongoDriver
    import acolyte.reactivemongo.AcolyteDSL.{ withDriver, handleWrite }
    import acolyte.reactivemongo.{ Request, WriteOp }
    
    withDriver(handleWrite { (op: WriteOp, req: Request) => aResponse }) { d =>
      val driver: MongoDriver = d // configured with given handler
      // work with driver (e.g. call you function using Mongo)
      "Value"
    }
    See also

    ConnectionHandler.withQueryHandler

  14. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def withCollection[T](db: DB, name: String)(f: (BSONCollection) ⇒ T)(implicit c: ExecutionContext): Future[T]

    Permalink

    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

    Collection name

    f

    Function applied to resolved Mongo collection

    import reactivemongo.api.Collection
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL.withFlatDB(handler) { db =>
      AcolyteDSL.withCollection(db, "colName") { col =>
        "Result"
      }
    }
    Definition Classes
    WithCollection
  25. def withCollection[T](con: ⇒ MongoConnection, name: String)(f: (BSONCollection) ⇒ T)(implicit c: ExecutionContext): Future[T]

    Permalink

    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

    Collection name

    f

    Function applied to resolved Mongo collection

    import reactivemongo.api.Collection
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL.withFlatConnection(handler) { con =>
      AcolyteDSL.withCollection(con, "colName") { col =>
        "Result"
      }
    }
    Definition Classes
    WithCollection
    See also

    WithDriver.withFlatDB[T]

  26. def withCollection[A, B](conParam: ⇒ A, name: String)(f: (BSONCollection) ⇒ B)(implicit d: MongoDriver, m: ConnectionManager[A], c: ExecutionContext): Future[B]

    Permalink

    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

    Collection name

    f

    Function applied to resolved Mongo collection

    import reactivemongo.api.Collection
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] =
      AcolyteDSL.withCollection(handler, "colName") { col =>
        "Result"
      }
    Definition Classes
    WithCollection
    See also

    AcolyteDSL.withFlatDB[A,B]

  27. def withConnection[A, B](conParam: ⇒ A)(f: (MongoConnection) ⇒ B)(implicit d: MongoDriver, m: ConnectionManager[A], c: ExecutionContext): Future[B]

    Permalink

    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

    the connection manager parameter (see ConnectionManager)

    f

    the function applied to initialized driver

    import reactivemongo.api.MongoConnection
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL.withConnection(handler) { con =>
      val c: MongoConnection = con
      "Result"
    }
    Definition Classes
    WithDriver
    See also

    withFlatConnection

    withFlatDriver

  28. def withDB[T](con: ⇒ MongoConnection)(f: (DefaultDB) ⇒ T)(implicit c: ExecutionContext): Future[T]

    Permalink

    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 reactivemongo.api.DB
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL withConnection(handler) { con =>
      AcolyteDSL withDB(con) { db =>
        val d: DefaultDB = db
        "Result"
      }
    }
    Definition Classes
    WithDB
    See also

    withFlatDB[T]

    AcolyteDSL.withConnection

  29. def withDB[A, B](conParam: ⇒ A)(f: (DefaultDB) ⇒ B)(implicit d: MongoDriver, m: ConnectionManager[A], c: ExecutionContext): Future[B]

    Permalink

    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). Driver and associated resources are released after the function f the result Future is completed.

    conParam

    the connection manager parameter (see ConnectionManager)

    f

    the function applied to initialized Mongo DB

    import reactivemongo.api.DB
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL withDB(handler) { db =>
      val d: DB = db
      "Result"
    }
    Definition Classes
    WithDB
    See also

    withFlatDB[A,B]

    AcolyteDSL.withConnection

  30. def withDriver[T](f: (MongoDriver) ⇒ T)(implicit m: DriverManager, c: ExecutionContext): Future[T]

    Permalink

    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 driver

    // handler: ConnectionHandler
    val s: Future[String] = withDriver { d =>
      val initedDriver: MongoDriver = d
      "Result"
    }
    Definition Classes
    WithDriver
    See also

    withFlatDriver

  31. def withFlatCollection[T](db: DB, name: String)(f: (BSONCollection) ⇒ Future[T])(implicit c: ExecutionContext): Future[T]

    Permalink

    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

    Collection name

    f

    Function applied to resolved Mongo collection

    import reactivemongo.api.Collection
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val i: Future[Int] = AcolyteDSL.withFlatDB(handler) { db =>
      AcolyteDSL.withFlatCollection(db, "colName") { col =>
        Future(1 + 2)
      }
    }
    Definition Classes
    WithCollection
  32. def withFlatCollection[T](con: ⇒ MongoConnection, name: String)(f: (BSONCollection) ⇒ Future[T])(implicit c: ExecutionContext): Future[T]

    Permalink

    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

    Collection name

    f

    Function applied to resolved Mongo collection

    import reactivemongo.api.Collection
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val i: Future[Int] = AcolyteDSL.withFlatConnection(handler) { con =>
      AcolyteDSL.withFlatCollection(con, "colName") { col =>
        Future(1 + 2)
      }
    }
    Definition Classes
    WithCollection
    See also

    WithDriver.withFlatDB[T]

  33. def withFlatCollection[A, B](conParam: ⇒ A, name: String)(f: (BSONCollection) ⇒ Future[B])(implicit d: MongoDriver, m: ConnectionManager[A], c: ExecutionContext): Future[B]

    Permalink

    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

    Collection name

    f

    Function applied to resolved Mongo collection

    import reactivemongo.api.Collection
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val i: Future[Int] =
      AcolyteDSL.withFlatCollection(handler, "colName") { col =>
        Future(1 + 2)
      }
    Definition Classes
    WithCollection
    See also

    AcolyteDSL.withFlatDB[A,B]

  34. def withFlatConnection[A, B](conParam: ⇒ A)(f: (MongoConnection) ⇒ Future[B])(implicit d: MongoDriver, m: ConnectionManager[A], c: ExecutionContext): Future[B]

    Permalink

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

    conParam

    the connection manager parameter (see ConnectionManager)

    f

    the function applied to initialized driver

    import reactivemongo.api.MongoConnection
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL.withFlatConnection(handler) { con =>
      val c: MongoConnection = con
      Future.successful("Result")
    }
    Definition Classes
    WithDriver
    See also

    withConnection

    withFlatDriver

  35. def withFlatDB[T](con: ⇒ MongoConnection)(f: (DefaultDB) ⇒ Future[T])(implicit c: ExecutionContext): Future[T]

    Permalink

    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 reactivemongo.api.DB
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL withConnection(handler) { con =>
      AcolyteDSL withDB(con) { db =>
        val d: DefaultDB = db
        Future.successful("Result")
      }
    }
    Definition Classes
    WithDB
    See also

    withFlatDB[T]

    AcolyteDSL.withConnection

  36. def withFlatDB[A, B](conParam: ⇒ A)(f: (DefaultDB) ⇒ Future[B])(implicit d: MongoDriver, m: ConnectionManager[A], c: ExecutionContext): Future[B]

    Permalink

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

    conParam

    the connection manager parameter (see ConnectionManager)

    f

    the function applied to initialized Mongo DB

    import reactivemongo.api.DB
    import acolyte.reactivemongo.AcolyteDSL
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL withFlatDB(handler) { db =>
      val d: DefaultDB = db
      Future.successful("Result")
    }
    Definition Classes
    WithDB
    See also

    withDB[A,B]

    AcolyteDSL.withFlatConnection

  37. def withFlatDriver[T](f: (MongoDriver) ⇒ Future[T])(implicit m: DriverManager, c: ExecutionContext): Future[T]

    Permalink

    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 driver (returning a future)

    // handler: ConnectionHandler
    val s: Future[String] = withFlatDriver { d =>
      val initedDriver: MongoDriver = d
      Future.successful("Result")
    }
    Definition Classes
    WithDriver
    See also

    withDriver

  38. def withFlatQueryHandler[T](handler: (Request) ⇒ PreparedResponse)(f: (MongoConnection) ⇒ Future[T])(implicit d: MongoDriver, m: ConnectionManager[ConnectionHandler], c: ExecutionContext): Future[T]

    Permalink

    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 reactivemongo.api.MongoConnection
    import acolyte.reactivemongo.{ AcolyteDSL, Request }
    AcolyteDSL.withFlatQueryHandler({ req: Request ⇒ aResponse }) { d =>
      val con: MongoConnection = d
      Future(1+2)
    }
    Definition Classes
    WithHandler
    See also

    AcolyteDSL.withQueryResult

    AcolyteDSL.handleQuery

    AcolyteDSL.withFlatDriver

  39. def withFlatQueryResult[A, B](result: ⇒ A)(f: (MongoConnection) ⇒ Future[B])(implicit d: MongoDriver, m: ConnectionManager[ConnectionHandler], mk: QueryResponseMaker[A], c: ExecutionContext): Future[B]

    Permalink

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

    AcolyteDSL.withFlatDriver

  40. def withFlatWriteHandler[T](handler: (WriteOp, Request) ⇒ PreparedResponse)(f: (MongoConnection) ⇒ Future[T])(implicit d: MongoDriver, m: ConnectionManager[ConnectionHandler], c: ExecutionContext): Future[T]

    Permalink

    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 reactivemongo.api.MongoConnection
    import acolyte.reactivemongo.{ AcolyteDSL, Request, WriteOp }
    AcolyteDSL.withWriteHandler({ cmd: (WriteOp, Request) ⇒ aResp }) { d =>
      val con: MongoConnection = d
      Future(1+2)
    }
    Definition Classes
    WithHandler
    See also

    AcolyteDSL.withFlatWriteResult

    AcolyteDSL.handleWrite

    AcolyteDSL.withFlatDriver

  41. def withFlatWriteResult[A, B](result: ⇒ A)(f: (MongoConnection) ⇒ Future[B])(implicit d: MongoDriver, m: ConnectionManager[ConnectionHandler], mk: WriteResponseMaker[A], c: ExecutionContext): Future[B]

    Permalink

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

    AcolyteDSL.withFlatDriver

  42. def withQueryHandler[T](handler: (Request) ⇒ PreparedResponse)(f: (MongoConnection) ⇒ T)(implicit d: MongoDriver, m: ConnectionManager[ConnectionHandler], c: ExecutionContext): Future[T]

    Permalink

    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 reactivemongo.api.MongoConnection
    import acolyte.reactivemongo.{ AcolyteDSL, Request }
    AcolyteDSL.withQueryHandler({ req: Request ⇒ aResponse }) { d =>
      val con: MongoConnection = d
      "aResult"
    }
    Definition Classes
    WithHandler
    See also

    AcolyteDSL.withQueryResult

    AcolyteDSL.handleQuery

    AcolyteDSL.withDriver

  43. def withQueryResult[A, B](result: ⇒ A)(f: (MongoConnection) ⇒ B)(implicit d: MongoDriver, m: ConnectionManager[ConnectionHandler], mk: QueryResponseMaker[A], c: ExecutionContext): Future[B]

    Permalink

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

    AcolyteDSL.handleQuery

    AcolyteDSL.withDriver

  44. def withWriteHandler[T](handler: (WriteOp, Request) ⇒ PreparedResponse)(f: (MongoConnection) ⇒ T)(implicit d: MongoDriver, m: ConnectionManager[ConnectionHandler], c: ExecutionContext): Future[T]

    Permalink

    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 reactivemongo.api.MongoConnection
    import acolyte.reactivemongo.{ AcolyteDSL, Request, WriteOp }
    AcolyteDSL.withWriteHandler({ cmd: (WriteOp, Request) ⇒ aResp }) { d =>
      val con: MongoConnection = d
      "aResult"
    }
    Definition Classes
    WithHandler
    See also

    AcolyteDSL.withWriteResult

    AcolyteDSL.handleWrite

    AcolyteDSL.withDriver

  45. def withWriteResult[A, B](result: ⇒ A)(f: (MongoConnection) ⇒ B)(implicit d: MongoDriver, m: ConnectionManager[ConnectionHandler], mk: WriteResponseMaker[A], c: ExecutionContext): Future[B]

    Permalink

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

    AcolyteDSL.handleWrite

    AcolyteDSL.withDriver

Inherited from WithResult

Inherited from WithHandler

Inherited from WithCollection

Inherited from WithDB

Inherited from WithDriver

Inherited from AnyRef

Inherited from Any

Ungrouped