object MongoConnection
Wrapper object for Mongo Connections, providing the static methods the Java driver gives. Apply methods are called as MongoConnection(<params>)
- Annotations
- @deprecated
- Deprecated
(Since version 2.7) Please use MongoClient
- Alphabetic
- By Inheritance
- MongoConnection
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(host: String, port: Int): MongoConnection
Connects to a (single) mongodb node
Connects to a (single) mongodb node
- host
(String) server to connect to
- port
(Int) the port on which the database is running
- Exceptions thrown
MongoException
on error
-
def
apply(host: String): MongoConnection
Connects to a (single) mongodb node (default port)
Connects to a (single) mongodb node (default port)
- host
(String) server to connect to
- Exceptions thrown
MongoException
on errorUnknownHostException
if cannot connect to the host
-
def
apply(left: Imports.ServerAddress, right: Imports.ServerAddress, options: MongoOptions): MongoConnection
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)
- left
(ServerAddress) the left side of the pair
- right
(ServerAddress) The right side of the pair
- options
(MongoOptions) the MongoDB Options for the connection
- Exceptions thrown
MongoException
on error- See also
MongoOptions
MongoDBAddress
ServerAddress
-
def
apply(left: Imports.ServerAddress, right: Imports.ServerAddress): MongoConnection
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)
- left
(ServerAddress) the left side of the pair
- right
(ServerAddress) The right side of the pair
- Exceptions thrown
MongoException
on error- See also
MongoDBAddress
ServerAddress
-
def
apply(addr: Imports.ServerAddress, options: Imports.MongoOptions): MongoConnection
Connects to a (single) mongodb node.
Connects to a (single) mongodb node.
- addr
(ServerAddress) the DatabaseAddress
- options
(MongoOptions) DB Options
- Exceptions thrown
MongoException
on error- See also
MongoOptions
MongoDBAddress
ServerAddress
-
def
apply(addr: Imports.ServerAddress): MongoConnection
Connects to a (single) mongodb node.
Connects to a (single) mongodb node.
- addr
(ServerAddress) the DatabaseAddress
- Exceptions thrown
MongoException
on error- See also
MongoDBAddress
ServerAddress
-
def
apply(uri: mongodb.MongoURI): MongoConnection
Connect via a com.mongodb.MongoURI
Connect via a com.mongodb.MongoURI
- uri
(com.mongodb.MongoURI)
-
def
apply(uri: MongoURI): MongoConnection
Connect via a MongoURI
Connect via a MongoURI
- uri
(MongoURI)
-
def
apply(replicaSetSeeds: List[Imports.ServerAddress], options: Imports.MongoOptions): MongoConnection
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
- replicaSetSeeds
(List[ServerAddress]) The servers to connect to
- Exceptions thrown
MongoException
on error- See also
MongoDBAddress
ServerAddress
-
def
apply(replicaSetSeeds: List[Imports.ServerAddress]): MongoConnection
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)
- replicaSetSeeds
(List[ServerAddress]) The servers to connect to
- Exceptions thrown
MongoException
on error- See also
MongoDBAddress
ServerAddress
-
def
apply(): MongoConnection
Default connection method - connects to default host & port
Default connection method - connects to default host & port
- Exceptions thrown
MongoException
on errorUnknownHostException
if cannot connect to the host
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )