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): 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 reactivemongo.api.Collection
    import acolyte.reactivemongo.AcolyteDSL
    
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL.withDB(handler) { db =>
      AcolyteDSL.withCollection(db, "colName") { col =>
        "Result"
      }
    }
    Definition Classes
    WithCollection
  27. 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 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.withDB[T]

  28. def withCollection[A, B](conParam: ⇒ A, name: String)(f: (BSONCollection) ⇒ B)(implicit d: MongoDriver, 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 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.withDB[A,B]

  29. def withConnection[A, B](conParam: ⇒ A)(f: (MongoConnection) ⇒ B)(implicit d: MongoDriver, 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 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
  30. def withDB[T](con: ⇒ MongoConnection, name: String)(f: (DefaultDB) ⇒ 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 reactivemongo.api.DB
    import acolyte.reactivemongo.AcolyteDSL
    
    // handler: ConnectionHandler
    val s: Future[String] = AcolyteDSL withConnection(handler) { con =>
      AcolyteDSL withDB(con, "my_db") { db =>
        val d: DefaultDB = db
        "Result"
      }
    }
    Definition Classes
    WithDB
    See also

    AcolyteDSL.withConnection

  31. def withDB[T](con: ⇒ MongoConnection)(f: (DefaultDB) ⇒ 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 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

    AcolyteDSL.withConnection

  32. def withDB[A, B](conParam: ⇒ A, name: String)(f: (DefaultDB) ⇒ B)(implicit d: MongoDriver, 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

    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, "my_db") { db =>
      val d: DB = db
      "Result"
    }
    Definition Classes
    WithDB
    See also

    AcolyteDSL.withConnection

  33. def withDB[A, B](conParam: ⇒ A)(f: (DefaultDB) ⇒ B)(implicit d: MongoDriver, 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 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

    AcolyteDSL.withConnection

  34. def withDriver[T](f: (MongoDriver) ⇒ 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

    // handler: ConnectionHandler
    val s: Future[String] = withDriver { d =>
      val initedDriver: MongoDriver = d
      "Result"
    }
    Definition Classes
    WithDriver
  35. def withQueryHandler[T](handler: (Request) ⇒ PreparedResponse)(f: (MongoConnection) ⇒ T)(implicit d: MongoDriver, 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 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

  36. def withQueryResult[A, B](result: ⇒ A)(f: (MongoConnection) ⇒ B)(implicit d: MongoDriver, 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.handleQuery

    AcolyteDSL.withFlatDriver

  37. def withWriteHandler[T](handler: (WriteOp, Request) ⇒ PreparedResponse)(f: (MongoConnection) ⇒ T)(implicit d: MongoDriver, 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 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

  38. def withWriteResult[A, B](result: ⇒ A)(f: (MongoConnection) ⇒ B)(implicit d: MongoDriver, 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.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