acolyte.reactivemongo

AcolyteDSL

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
Learn more about member selection
Visibility
  1. Public
  2. All

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

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

    Returns unmanaged driver.

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

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

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

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

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

    Definition Classes
    AnyRef → Any
  13. def handle: ConnectionHandler

    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

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

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

  16. def hashCode(): Int

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

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

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

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

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

    Definition Classes
    AnyRef
  22. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def withCollection[T](db: DB, name: String)(f: (BSONCollection) ⇒ T)(implicit c: ExecutionContext): Future[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

    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
  27. def withCollection[T](con: ⇒ MongoConnection, name: String)(f: (BSONCollection) ⇒ T)(implicit c: ExecutionContext): Future[T]

    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]

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

    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]

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

    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 Mongo DB

    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

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

    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

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

    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

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

    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

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

    withFlatDriver

  33. def withFlatCollection[T](db: DB, name: String)(f: (BSONCollection) ⇒ Future[T])(implicit c: ExecutionContext): Future[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

    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
  34. def withFlatCollection[T](con: ⇒ MongoConnection, name: String)(f: (BSONCollection) ⇒ Future[T])(implicit c: ExecutionContext): Future[T]

    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]

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

    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]

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

    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 Mongo DB

    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

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

    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

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

    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

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

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

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

    withDriver

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

    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

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

    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

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

    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

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

    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

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

    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

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

    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

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

    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

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

    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