Manipulate Network Options
Manipulate Network Options
com.mongodb.Bytes
com.mongodb.Mongo
Apply method to proxy getCollection, to allow invocation of
dbInstance("collectionName")
instead of getCollection
Apply method to proxy getCollection, to allow invocation of
dbInstance("collectionName")
instead of getCollection
a string for the collection name
MongoCollection A wrapped instance of a Mongo DBCollection Class returning generic DBObjects
Checks to see if a collection by name %lt;name> exists.
Checks to see if a collection by name %lt;name> exists.
The collection to test for existence
false if no collection by that name exists, true if a match to an existing collection was found
Returns a set of the names of collections in this database.
Returns a set of the names of collections in this database.
the names of collections in this database
Execute a database command directly.
Execute a database command directly.
the result of the command from the database
Execute a database command directly.
Execute a database command directly.
the result of the command from the database
Execute a database command directly.
Execute a database command directly.
the result of the command from the database
Creates a collection with a given name and options.
Creates a collection with a given name and options. If the collection does not exist, a new collection is created. Possible options: <dl> <dt>capped</dt>
the name of the collection to return
options
the collection
Drops this database.
Drops this database. Removes all data on disk. Use with caution.
Gets a collection with a given name.
Gets a collection with a given name. If the collection does not exist, a new collection is created.
(String) the name of the collection to return
the collection
Returns a collection matching a given string.
Returns a collection matching a given string.
the name of the collection
the collection
Returns a set of the names of collections in this database.
Returns a set of the names of collections in this database.
the names of collections in this database
Manipulate Network Options
Manipulate Network Options
com.mognodb.Bytes
com.mongodb.Mongo
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.
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.
WriteConcern
The Java Driver is a bit outdated and is missing the finalize option.
The Java Driver is a bit outdated and is missing the finalize option. Additionally, it returns ZERO information about the actual results of the mapreduce, just a cursor to the result collection. This is less than ideal. So I've wrapped it in something more useful.
An instance of MapReduceCommand representing the required MapReduce
MapReduceResult a wrapped result object. This contains the returns success, counts etc, but implements iterator and can be iterated directly
Manipulate Network Options
Manipulate Network Options
com.mognodb.Bytes
com.mongodb.Mongo
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.
Manipulate Network Options
Manipulate Network Options
com.mongodb.Bytes
com.mongodb.Mongo
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.
Read Preference to use
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.
(WriteConcern) The write concern to use
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
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.
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
WriteConcern
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.
(WriteConcern) The write concern to use
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
WriteConcern
Adds or updates a user for this database
Adds or updates a user for this database
the user name
the password
the result of executing this operation
(Since version 2.8) This will be removed in a future release
Authenticates connection/db with given name and password
Authenticates connection/db with given name and password
name of user for this database
password of user for this database
true if authenticated, false otherwise
(Since version 2.7) Please use MongoClient to create a client, which will authenticate all connections to server.
Checked write block
Checked write block
(Since version 2.8) This will be removed in a future release
if error
Execute a database command directly.
Execute a database command directly.
the result of the command from the database
(Since version 2.8) This will be removed in a future release
Execute a database command directly.
Execute a database command directly.
the result of the command from the database
(Since version 2.8) This will be removed in a future release
For testing purposes only - this method forces an error to help test error handling
For testing purposes only - this method forces an error to help test error handling
(Since version 2.8) This will be removed in a future release
(Since version 2.8) This will be removed in a future release
(Since version 2.8) This will be removed in a future release
Gets the the error (if there is one) from the previous operation.
Gets the the error (if there is one) from the previous operation. The result of this command will look like
{ "err" : errorMessage , "ok" : 1.0 }
The value for errorMessage will be null if no error occurred, or a description otherwise.
Care must be taken to ensure that calls to getLastError go to the same connection as that of the previous operation. See com.mongodb.Mongo.requestStart for more information.
DBObject with error and status information
(Since version 2.8) This will be removed in a future release
Returns the last error that occurred since start of database or a call to resetError()
Returns the last error that occurred since start of database or a call to resetError()
The return object will look like
{ err : errorMessage, nPrev : countOpsBack, ok : 1 }
The value for errormMessage will be null of no error has ocurred, or the message. The value of countOpsBack will be the number of operations since the error occurred.
Care must be taken to ensure that calls to getPreviousError go to the same connection as that of the previous operation. See com.mongodb.Mongo.requestStart for more information.
DBObject with error and status information
(Since version 2.7) This will be removed in a future release
Returns true if this DB is authenticated
Returns true if this DB is authenticated
true if authenticated, false otherwise
(Since version 2.7) Use MongoClient to create an authenticated connection.
(Since version 2.8) This will be removed in a future release
(Since version 2.8) This will be removed in a future release
(Since version 2.8) This will be removed in a future release
Makes this database read-only
Makes this database read-only
if the database should be read-only
(Since version 2.7) Avoid making database read-only via this method. Use a read-only user with MongoClient instead.
write concern aware write op block.
write concern aware write op block.
Checks getLastError after the last write. If you run multiple ops you'll only get the final error.
Your op function gets a copy of this MongoDB instance.
This is for write ops only - you cannot return data from it.
Your function must return WriteResult, which is the return type of any mongo write operation like insert/save/update/remove
(Since version 2.8) This will be removed in a future release
if error
write concern aware write op block.
write concern aware write op block.
Checks getLastError after the last write. If you run multiple ops you'll only get the final error.
Your op function gets a copy of this MongoDB instance.
This is for write ops only - you cannot return data from it.
Your function must return WriteResult, which is the return type of any mongo write operation like insert/save/update/remove
(Since version 2.8) This will be removed in a future release
if error
write concern aware write op block.
write concern aware write op block.
Checks getLastError after the last write. If you run multiple ops you'll only get the final error.
Your op function gets a copy of this MongoDB instance.
This is for write ops only - you cannot return data from it.
Your function must return WriteResult, which is the return type of any mongo write operation like insert/save/update/remove
If you have set a connection or DB level WriteConcern, it will be inherited.
(Since version 2.8) This will be removed in a future release
if error
Ends the current 'consistent request'.
Ends the current 'consistent request'.
(Since version 2.8) This will be removed in a future release
Ensure that a connection is assigned to the current "consistent request" (from primary pool, if connected to a replica set).
Ensure that a connection is assigned to the current "consistent request" (from primary pool, if connected to a replica set).
(Since version 2.8) This will be removed in a future release
Starts a new 'consistent request'.
Starts a new 'consistent request'.
Following this call and until requestDone() is called, all db operations will use the same underlying connection.
(Since version 2.8) This will be removed in a future release
Resets the error memory for this database.
Resets the error memory for this database. Used to clear all errors such that getPreviousError() will return no error.
(Since version 2.7) This will be removed in a future release
Makes this database read-only
Makes this database read-only
if the database should be read-only
(Since version 2.7) Avoid making database read-only via this method. Use a read-only user with MongoClient instead.
Sets queries to be OK to run on slave nodes.
Sets queries to be OK to run on slave nodes.
(Since version 2.3.0) Replaced with ReadPreference.SECONDARY.
Wrapper for the Mongo
DB
object providing scala-friendly functionality.1.0
com.mongodb.DB