Returns unmanaged driver.
Returns unmanaged driver. You will have to close it by yourself.
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" }
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" }
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" }
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.
Previously resolved Mongo DB
Collection name
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" } }
Works with specified collection from Mongo database "acolyte" resolved using given connection.
Works with specified collection from Mongo database "acolyte" resolved using given connection.
Previously initialized connection
Collection name
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" } }
WithDriver.withFlatDB[T]
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.
Connection manager parameter (see ConnectionManager)
Collection name
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" }
AcolyteDSL.withFlatDB[A,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.
Connection manager parameter (see ConnectionManager)
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" }
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).
Previously initialized connection
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" } }
withFlatDB[T]
AcolyteDSL.withConnection
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.
Connection manager parameter (see ConnectionManager)
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" }
withFlatDB[A,B]
AcolyteDSL.withConnection
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.
Function applied to initialized driver
// handler: ConnectionHandler val s: Future[String] = withDriver { d => val initedDriver: MongoDriver = d "Result" }
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.
Previously resolved Mongo DB
Collection name
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) } }
Works with specified collection from Mongo database "acolyte" resolved using given connection.
Works with specified collection from Mongo database "acolyte" resolved using given connection.
Previously initialized connection
Collection name
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) } }
WithDriver.withFlatDB[T]
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.
Connection manager parameter (see ConnectionManager)
Collection name
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) }
AcolyteDSL.withFlatDB[A,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 manager parameter (see ConnectionManager)
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") }
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).
Previously initialized connection
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") } }
withFlatDB[T]
AcolyteDSL.withConnection
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).
Connection manager parameter (see ConnectionManager)
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") }
withDB[A,B]
AcolyteDSL.withFlatConnection
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.
Function applied to initialized driver (returning a future)
// handler: ConnectionHandler val s: Future[String] = withFlatDriver { d => val initedDriver: MongoDriver = d Future.successful("Result") }
Works with a Mongo driver handling only queries,
using given query handler
.
Works with a Mongo driver handling only queries,
using given query handler
.
Driver and associated resources are released
after the function f
the result Future
is completed.
Query handler
import reactivemongo.api.MongoConnection import acolyte.reactivemongo.{ AcolyteDSL, Request } AcolyteDSL.withFlatQueryHandler({ req: Request ¬ヌメ aResponse }) { d => val con: MongoConnection = d Future(1+2) }
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.
Query result
Works with a Mongo driver handling only write operations,
using given write handler
.
Works with a Mongo driver handling only write operations,
using given write handler
.
Driver and associated resources are released
after the function f
the result Future
is completed.
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) }
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.
Works with a Mongo driver handling only queries,
using given query handler
.
Works with a Mongo driver handling only queries,
using given query handler
.
Driver and associated resources are released
after the function f
the result Future
is completed.
Query handler
import reactivemongo.api.MongoConnection import acolyte.reactivemongo.{ AcolyteDSL, Request } AcolyteDSL.withQueryHandler({ req: Request ¬ヌメ aResponse }) { d => val con: MongoConnection = d "aResult" }
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.
Query result
Works with a Mongo driver handling only write operations,
using given write handler
.
Works with a Mongo driver handling only write operations,
using given write handler
.
Driver and associated resources are released
after the function f
the result Future
is completed.
Writer handler
import reactivemongo.api.MongoConnection import acolyte.reactivemongo.{ AcolyteDSL, Request, WriteOp } AcolyteDSL.withWriteHandler({ cmd: (WriteOp, Request) ¬ヌメ aResp }) { d => val con: MongoConnection = d "aResult" }
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.
Acolyte DSL for ReactiveMongo.