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
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
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.
For testing purposes only - this method forces an error to help test error handling
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
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
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 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 WriteConcern
for more info.
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
,WriteConcern
Returns true if this DB is authenticated
Returns true if this DB is authenticated
true if authenticated, false otherwise
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.
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
Makes this database read-only
Makes this database read-only
if the database should be read-only
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 ReadPreference
for more information.
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
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
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.
Manipulate Network Options
Manipulate Network Options
com.mongodb.Bytes
,com.mongodb.Mongo
Makes this database read-only
Makes this database read-only
if the database should be read-only
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 ReadPreference
for more information.
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 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 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 WriteConcern
for more info.
(WriteConcern) The write concern to use
http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
,WriteConcern
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
The getPreviousError() and resetError() commands are deprecated and may be removed in future versions of MongoDB
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.
The getPreviousError() and resetError() commands are deprecated and may be removed in future versions of MongoDB
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