Connects to a (single) mongodb node
Connects to a (single) mongodb node
(String) server to connect to
(Int) the port on which the database is running
MongoException
on error
Connects to a (single) mongodb node (default port)
Connects to a (single) mongodb node (default port)
(String) server to connect to
MongoException
on error
UnknownHostException
if cannot connect to the host
Creates a Mongo connection in paired mode.
Creates a Mongo connection in paired mode. This will also work for a replica set and will find all the members (the master will be used by default)
(ServerAddress) the left side of the pair
(ServerAddress) The right side of the pair
(MongoOptions) the MongoDB Options for the connection
MongoException
on error
MongoOptions
MongoDBAddress
ServerAddress
Creates a Mongo connection in paired mode.
Creates a Mongo connection in paired mode. This will also work for a replica set and will find all the members (the master will be used by default)
(ServerAddress) the left side of the pair
(ServerAddress) The right side of the pair
MongoException
on error
MongoDBAddress
ServerAddress
Connects to a (single) mongodb node.
Connects to a (single) mongodb node.
(ServerAddress) the DatabaseAddress
(MongoOptions) DB Options
MongoException
on error
MongoOptions
MongoDBAddress
ServerAddress
Connects to a (single) mongodb node.
Connects to a (single) mongodb node.
(ServerAddress) the DatabaseAddress
MongoException
on error
MongoDBAddress
ServerAddress
Connect via a com.mongodb.MongoURI
Connect via a com.mongodb.MongoURI
(com.mongodb.MongoURI)
Connect via a MongoURI
Connect via a MongoURI
(MongoURI)
Replica Set connection This works for a replica set or pair, and finds all the members (the master is used by default) Takes a MongoOptions object
Replica Set connection This works for a replica set or pair, and finds all the members (the master is used by default) Takes a MongoOptions object
(List[ServerAddress]) The servers to connect to
MongoException
on error
MongoDBAddress
ServerAddress
Replica Set connection This works for a replica set or pair, and finds all the members (the master is used by default)
Replica Set connection This works for a replica set or pair, and finds all the members (the master is used by default)
(List[ServerAddress]) The servers to connect to
MongoException
on error
MongoDBAddress
ServerAddress
Default connection method - connects to default host & port
Default connection method - connects to default host & port
MongoException
on error
UnknownHostException
if cannot connect to the host
Wrapper object for Mongo Connections, providing the static methods the Java driver gives. Apply methods are called as MongoConnection(<params>)
(Since version 2.7) Please use MongoClient