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).
a previously initialized connection
the name of database
the function applied to initialized Mongo DB
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.{ DB, AsyncDriver } import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler } // handler: ConnectionHandler def s(handler: ConnectionHandler)( implicit ec: ExecutionContext, d: AsyncDriver): Future[String] = AcolyteDSL.withConnection(handler) { con => AcolyteDSL.withDB(con, "my_db") { db => val d: DB = db "Result" } }
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).
a previously initialized connection
the function applied to initialized Mongo DB
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.{ DB, AsyncDriver } import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler } def s(handler: ConnectionHandler)( implicit ec: ExecutionContext, d: AsyncDriver) = AcolyteDSL.withConnection(handler) { con => AcolyteDSL.withDB(con) { db => val d: DB = db "Result" } }
AcolyteDSL.withConnection
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.
the connection manager parameter (see ConnectionManager)
the name of database
the function applied to initialized Mongo DB
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.{ DB, AsyncDriver } import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler } def s(handler: ConnectionHandler)( implicit ec: ExecutionContext, d: AsyncDriver): Future[String] = AcolyteDSL.withDB(handler, "my_db") { db => val d: DB = db "Result" }
AcolyteDSL.withConnection
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.
the connection manager parameter (see ConnectionManager)
the function applied to initialized Mongo DB
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.{ DB, AsyncDriver } import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler } def s(handler: ConnectionHandler)( implicit ec: ExecutionContext, d: AsyncDriver): Future[String] = AcolyteDSL.withDB(handler) { db => val d: DB = db "Result" }
AcolyteDSL.withConnection
Functions to work with MongoDB (provided driver functions).