acolyte.reactivemongo

AcolyteDSL

object AcolyteDSL extends WithDriver with WithDB with WithCollection with WithResult

Acolyte DSL for ReactiveMongo.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AcolyteDSL
  2. WithResult
  3. WithCollection
  4. WithDB
  5. WithDriver
  6. AnyRef
  7. 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. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  12. 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

  13. def handleQuery(handler: 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

  14. def handleWrite(handler: 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

  15. def hashCode(): Int

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

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

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

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

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

    Definition Classes
    AnyRef
  21. def toString(): String

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

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

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

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

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

    Works with specified collection from Mongo database "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
  26. def withCollection[T](con: ⇒ MongoConnection, name: String)(f: (BSONCollection) ⇒ T)(implicit c: ExecutionContext): Future[T]

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

    Works with specified collection from Mongo database "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

  27. def withCollection[A, B](driverParam: ⇒ A, name: String)(f: (BSONCollection) ⇒ B)(implicit m: DriverManager[A], c: ExecutionContext): Future[B]

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

    Works with specified collection from Mongo database "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.

    driverParam

    Driver manager parameter (see DriverManager)

    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

  28. def withConnection[A, B](driverParam: ⇒ A)(f: (MongoConnection) ⇒ B)(implicit m: DriverManager[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.

    driverParam

    Driver manager parameter (see DriverManager)

    f

    Function applied to initialized connection

    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

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

    f

    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: DB = db
        "Result"
      }
    }
    Definition Classes
    WithDB
    See also

    withFlatDB

    AcolyteDSL.withConnection

  30. def withDB[A, B](driverParam: ⇒ A)(f: (DB) ⇒ B)(implicit m: DriverManager[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.

    driverParam

    Driver manager parameter (see DriverManager)

    f

    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

    AcolyteDSL.withConnection

  31. def withDriver[A, B](driverParam: ⇒ A)(f: (MongoDriver) ⇒ B)(implicit m: DriverManager[A], c: ExecutionContext): Future[B]

    Works with Mongo driver configured with Acolyte handlers.

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

    driverParam

    Driver manager parameter (see DriverManager)

    f

    Function applied to initialized driver

    // handler: ConnectionHandler
    val s: Future[String] = withDriver(handler) { d =>
      val initedDriver: MongoDriver = d
      "Result"
    }
    
    val i: Future[Int] = withDriver(alreadyInitedDriver) { d =>
      val unchangedDriver: MongoDriver = d
      1 // Result
    }
    Definition Classes
    WithDriver
    See also

    withFlatDriver

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

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

    Works with specified collection from Mongo database "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
  33. def withFlatCollection[T](con: ⇒ MongoConnection, name: String)(f: (BSONCollection) ⇒ Future[T])(implicit c: ExecutionContext): Future[T]

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

    Works with specified collection from Mongo database "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

  34. def withFlatCollection[A, B](driverParam: ⇒ A, name: String)(f: (BSONCollection) ⇒ Future[B])(implicit m: DriverManager[A], c: ExecutionContext): Future[B]

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

    Works with specified collection from Mongo database "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.

    driverParam

    Driver manager parameter (see DriverManager)

    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

  35. def withFlatConnection[A, B](driverParam: ⇒ A)(f: (MongoConnection) ⇒ Future[B])(implicit m: DriverManager[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).

    driverParam

    Driver manager parameter (see DriverManager)

    f

    Function applied to initialized connection

    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

  36. def withFlatDB[T](con: ⇒ MongoConnection)(f: (DB) ⇒ 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).

    f

    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: DB = db
        Future.successful("Result")
      }
    }
    Definition Classes
    WithDB
    See also

    withFlatDB

    AcolyteDSL.withConnection

  37. def withFlatDB[A, B](driverParam: ⇒ A)(f: (DB) ⇒ Future[B])(implicit m: DriverManager[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).

    driverParam

    Driver manager parameter (see DriverManager)

    f

    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: DB = db
      Future.successful("Result")
    }
    Definition Classes
    WithDB
    See also

    withDB

    AcolyteDSL.withFlatConnection

  38. def withFlatDriver[A, B](driverParam: ⇒ A)(f: (MongoDriver) ⇒ Future[B])(implicit m: DriverManager[A], c: ExecutionContext): Future[B]

    Works with Mongo driver configured with Acolyte handlers.

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

    driverParam

    Driver manager parameter (see DriverManager)

    f

    Function applied to initialized driver (returning a future)

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

    withDriver

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

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

    Works with a Mongo 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.

    import acolyte.reactivemongo.AcolyteDSL
    Definition Classes
    WithResult
    See also

    AcolyteDSL.handleQuery

    AcolyteDSL.withFlatDriver

  40. def withFlatWriteResult[A, B](result: ⇒ A)(f: (MongoDriver) ⇒ Future[B])(implicit m: DriverManager[ConnectionHandler], mk: WriteResponseMaker[A], c: ExecutionContext): Future[B]

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

    Works with a Mongo 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.

    import acolyte.reactivemongo.AcolyteDSL
    Definition Classes
    WithResult
    See also

    AcolyteDSL.handleWrite

    AcolyteDSL.withFlatDriver

  41. def withQueryResult[A, B](result: ⇒ A)(f: (MongoDriver) ⇒ B)(implicit m: DriverManager[ConnectionHandler], mk: QueryResponseMaker[A], c: ExecutionContext): Future[B]

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

    Works with a Mongo 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.

    import acolyte.reactivemongo.AcolyteDSL
    Definition Classes
    WithResult
    See also

    AcolyteDSL.handleQuery

    AcolyteDSL.withDriver

  42. def withWriteResult[A, B](result: ⇒ A)(f: (MongoDriver) ⇒ B)(implicit m: DriverManager[ConnectionHandler], mk: WriteResponseMaker[A], c: ExecutionContext): Future[B]

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

    Works with a Mongo 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.

    import acolyte.reactivemongo.AcolyteDSL
    Definition Classes
    WithResult
    See also

    AcolyteDSL.handleWrite

    AcolyteDSL.withDriver

Inherited from WithResult

Inherited from WithCollection

Inherited from WithDB

Inherited from WithDriver

Inherited from AnyRef

Inherited from Any

Ungrouped