object MongoClient
Provides functions for connecting to a MongoDB server or cluster.
There are three main ways to connect to a MongoDB cluster:
- the local one (which basically attempts to connect to ServerAddress.default.
- a list of server addresses.
- a MongoDB URI describing a server cluster.
The first two come with a xyzWith
variant that lets you pass in options at connection time.
- Source
- MongoClient.scala
- Alphabetic
- By Inheritance
- MongoClient
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final case class DatabaseInfo (name: String, sizeOnDisk: Double, empty: Boolean) extends Product with Serializable
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
-
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] )
-
def
fromAddress(cluster: List[ServerAddress], creds: MongoCredential*): MongoClient
Connects to the specified MongoDB cluster, using the specified credentials.
-
def
fromAddressWith(cluster: List[ServerAddress], creds: MongoCredential*)(options: MongoClientOptions): MongoClient
Connects to the specified MongoDB cluster, using the specified credentials and options.
Connects to the specified MongoDB cluster, using the specified credentials and options.
Specify an empty list for anonymous login.
-
def
fromUri(uri: String): Option[MongoClient]
Connects to the specified MongoDB cluster.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
local(creds: MongoCredential*): MongoClient
Connects to the local MongoDB server, using the specified credentials.
-
def
localWith(creds: MongoCredential*)(options: MongoClientOptions): MongoClient
Connects to the local MongoDB server, using the specified credentials and options.
Connects to the local MongoDB server, using the specified credentials and options.
Specify an empty list for anonymous login.
-
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( ... )
- object DatabaseInfo extends Serializable