Creates a new MongoConnection.
Creates a new MongoConnection.
The list of node names (e.g. node1.foo.com:27017); Port is optional (27017 is used by default)
the options for the new connection pool
the name for the connection pool
a classloader used to load the actor system
a classloader used to load the actor system
Closes this driver (and all its connections and resources).
Closes this driver (and all its connections and resources). Will wait until the timeout for proper closing of connections before forcing hard shutdown.
import scala.concurrent.ExecutionContext def afterClose(drv: reactivemongo.api.AsyncDriver)( implicit ec: ExecutionContext) = drv.close().andThen { case res => println("Close 'Try' result: " + res) }
a custom configuration (otherwise the default options are used)
a custom configuration (otherwise the default options are used)
Creates a new MongoConnection from URI.
Creates a new MongoConnection from URI.
the URI parsed by reactivemongo.api.MongoConnection.fromString
import scala.concurrent.Future import reactivemongo.api.MongoConnection, MongoConnection.ParsedURI val driver = reactivemongo.api.AsyncDriver() def con(uri: ParsedURI): Future[MongoConnection] = driver.connect(uri) // with automatic name
Creates a new MongoConnection from URI.
Creates a new MongoConnection from URI.
The URI parsed by reactivemongo.api.MongoConnection.fromString
the name for the connection pool
the flag to indicate whether the given URI must be a strict one (no ignored/invalid options)
import scala.concurrent.Future import reactivemongo.api.MongoConnection, MongoConnection.ParsedURI val driver = reactivemongo.api.AsyncDriver() def con(uri: ParsedURI): Future[MongoConnection] = driver.connect(uri, name = Some("ConnectionName"))
Creates a new MongoConnection from URI.
Creates a new MongoConnection from URI.
The URI parsed by reactivemongo.api.MongoConnection.fromString
the name for the connection pool
import scala.concurrent.Future import reactivemongo.api.MongoConnection, MongoConnection.ParsedURI val driver = reactivemongo.api.AsyncDriver() def con(uri: ParsedURI): Future[MongoConnection] = driver.connect(uri, name = Some("ConnectionName"))
Creates a new MongoConnection from URI.
Creates a new MongoConnection from URI.
the strict URI, that will be parsed by reactivemongo.api.MongoConnection.fromString
the name for the connection pool
import scala.concurrent.Future import reactivemongo.api.MongoConnection val driver = reactivemongo.api.AsyncDriver() val con: Future[MongoConnection] = driver.connect("mongodb://user123:passwd123@host1:27018,host2:27019,host3:27020/somedb?foo=bar&authenticationMechanism=scram-sha1", name = Some("ConnectionName"))
Creates a new MongoConnection from URI.
Creates a new MongoConnection from URI.
the strict URI, that will be parsed by reactivemongo.api.MongoConnection.fromString
import scala.concurrent.Future import reactivemongo.api.MongoConnection val driver = reactivemongo.api.AsyncDriver() val con: Future[MongoConnection] = driver.connect("mongodb://user123:passwd123@host1:27018,host2:27019,host3:27020/somedb?foo=bar&authenticationMechanism=scram-sha1") // with automatic name
Creates a new MongoConnection.
Creates a new MongoConnection.
The list of node names (e.g. node1.foo.com:27017); Port is optional (27017 is used by default)
the options for the new connection pool
the name for the connection pool
import scala.concurrent.Future import reactivemongo.api.{ MongoConnection, MongoConnectionOptions } val driver = reactivemongo.api.AsyncDriver() val con: Future[MongoConnection] = driver.connect( nodes = Seq("node1:27017", "node2:27017", "node3:27017"), options = MongoConnectionOptions.default.copy(nbChannelsPerNode = 10), name = "ConnectionName")
Creates a new MongoConnection.
Creates a new MongoConnection.
The list of node names (e.g. node1.foo.com:27017); Port is optional (27017 is used by default)
the options for the new connection pool
import scala.concurrent.Future import reactivemongo.api.{ MongoConnection, MongoConnectionOptions } val driver = reactivemongo.api.AsyncDriver() val con: Future[MongoConnection] = driver.connect( nodes = Seq("node1:27017", "node2:27017", "node3:27017"), options = MongoConnectionOptions.default.copy(nbChannelsPerNode = 10)) // with automatic name
Creates a new MongoConnection.
Creates a new MongoConnection.
The list of node names (e.g. node1.foo.com:27017); Port is optional (27017 is used by default)
import scala.concurrent.Future import reactivemongo.api.MongoConnection val driver = reactivemongo.api.AsyncDriver() val con: Future[MongoConnection] = driver.connect( Seq("node1:27017", "node2:27017", "node3:27017")) // with default options and automatic name
The asynchronous driver (see MongoConnection).