class MongoConnection extends AnyRef
Wrapper class for the Mongo Connection object.
- Annotations
- @deprecated
- Deprecated
(Since version 2.7) Please use MongoClient
- Alphabetic
- By Inheritance
- MongoConnection
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new MongoConnection(underlying: Mongo)
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
addOption(option: Int): Unit
Manipulate Network Options
Manipulate Network Options
- See also
com.mongodb.Bytes
com.mongodb.Mongo
-
def
address: Imports.ServerAddress
Gets the address of this database.
Gets the address of this database.
- returns
(ServerAddress) The address of the DB
- def allAddress: Buffer[Imports.ServerAddress]
-
def
apply(dbName: String): MongoDB
Apply method which proxies getDB, allowing you to call
connInstance("dbName")
Apply method which proxies getDB, allowing you to call
connInstance("dbName")
- dbName
(String) A string for the database name
- returns
MongoDB A wrapped instance of a Mongo 'DB Class.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
close(): Unit
Closes all open connections.
Closes all open connections. NOTE: This connection can't be reused after closing.
- def connectPoint: String
-
def
databaseNames(): Buffer[String]
- Exceptions thrown
MongoException
on error
-
def
dbNames(): Buffer[String]
- Exceptions thrown
MongoException
on error
-
def
dropDatabase(dbName: String): Unit
Drops the database if it exists.
Drops the database if it exists.
- dbName
(String) the name of the database to drop
- Exceptions thrown
MongoException
on error
-
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
getAddress: Imports.ServerAddress
Gets the address of this database.
Gets the address of this database.
- returns
(ServerAddress) The address of the DB
- def getAllAddress: Buffer[Imports.ServerAddress]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- def getConnectPoint: String
- def getDB(dbName: String): MongoDB
-
def
getDatabaseNames(): Buffer[String]
- Exceptions thrown
MongoException
on error
-
def
getOptions: Int
Manipulate Network Options
Manipulate Network Options
- See also
com.mognodb.Bytes
com.mongodb.Mongo
-
def
getReadPreference: Imports.ReadPreference
Gets the read preference for this database.
Gets the read preference for this database. Will be used as default for reads from any collection in this database. See the documentation for com.mongodb.ReadPreference for more information.
-
def
getWriteConcern: Imports.WriteConcern
get the write concern for this database, which is used for writes to any collection in this database.
get the write concern for this database, which is used for writes to any collection in this database. See the documentation for com.mongodb.WriteConcern for more info.
- See also
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
WriteConcern
-
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
-
def
options: Int
Manipulate Network Options
Manipulate Network Options
- See also
com.mognodb.Bytes
com.mongodb.Mongo
-
def
readPreference: Imports.ReadPreference
Gets the read preference for this database.
Gets the read preference for this database. Will be used as default for reads from any collection in this database. See the documentation for com.mongodb.ReadPreference for more information.
-
def
readPreference_=(pref: Imports.ReadPreference): Unit
Sets the read preference for this database.
Sets the read preference for this database. Will be used as default for reads from any collection in this database. See the documentation for com.mongodb.ReadPreference for more information.
- pref
Read Preference to use
-
def
resetOptions(): Unit
Manipulate Network Options
Manipulate Network Options
- See also
com.mongodb.Bytes
com.mongodb.Mongo
-
def
setReadPreference(pref: Imports.ReadPreference): Unit
Sets the read preference for this database.
Sets the read preference for this database. Will be used as default for reads from any collection in this database. See the documentation for com.mongodb.ReadPreference for more information.
- pref
Read Preference to use
-
def
setWriteConcern(concern: Imports.WriteConcern): Unit
Set the write concern for this database.
Set the write concern for this database. Will be used for writes to any collection in this database. See the documentation for com.mongodb.WriteConcern for more info.
- concern
(WriteConcern) The write concern to use
- See also
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
WriteConcern
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- val underlying: Mongo
-
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( ... )
-
def
writeConcern: Imports.WriteConcern
get the write concern for this database, which is used for writes to any collection in this database.
get the write concern for this database, which is used for writes to any collection in this database. See the documentation for com.mongodb.WriteConcern for more info.
- See also
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
WriteConcern
-
def
writeConcern_=(concern: Imports.WriteConcern): Unit
Set the write concern for this database.
Set the write concern for this database. Will be used for writes to any collection in this database. See the documentation for com.mongodb.WriteConcern for more info.
- concern
(WriteConcern) The write concern to use
- See also
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
WriteConcern
Deprecated Value Members
-
def
slaveOk(): Unit
Sets queries to be OK to run on slave nodes.
Sets queries to be OK to run on slave nodes.
- Annotations
- @deprecated
- Deprecated
(Since version 2.3.0) Replaced with
ReadPreference.SECONDARY