| Package | Description |
|---|---|
| com.mongodb |
Main package with core files.
|
| com.mongodb.gridfs |
GridFS tools.
|
| org.bson |
Contains the base BSON classes and Encoder/Decoder.
|
| Modifier and Type | Class and Description |
|---|---|
class |
BasicDBList
An implementation of List that reflects the way BSON lists work.
|
class |
BasicDBObject
A basic implementation of BSON object that is MongoDB specific.
|
class |
CommandResult
A simple wrapper to hold the result of a command.
|
class |
LazyDBObject
An immutable
DBObject backed by a byte buffer that lazily provides keys and values on request. |
class |
LazyWriteableDBObject
Deprecated.
This class will be removed in a future release. There is no replacement.
|
class |
RawDBObject
Deprecated.
This class is NOT a part of public API and will be dropped in 3.x versions.
|
class |
ReflectionDBObject
This class enables to map simple Class fields to a BSON object fields
|
| Modifier and Type | Field and Description |
|---|---|
protected DBObject |
AggregationOutput._cmd
Deprecated.
Please use
AggregationOutput.getCommand() instead. |
(package private) DBObject |
MapReduceOutput._cmd |
private DBObject |
DBCursor._cur |
(package private) DBObject |
MapReduceCommand._extra |
private DBObject |
DBCursor._hintDBObj |
private DBObject |
DBCursor._keysWanted |
private DBObject |
DBCursor._orderBy |
(package private) DBObject |
DBPointer._parent
Deprecated.
|
private DBObject |
DBRefBase._pointedTo
Deprecated.
|
private DBObject |
QueryBuilder._query |
private DBObject |
OutMessage._query |
(package private) DBObject |
MapReduceCommand._query |
private DBObject |
DBCursor._query |
(package private) DBObject |
MapReduceCommand._sort |
private DBObject |
DBCursor._specialFields |
private DBObject |
ReadPreference.TaggedReadPreference._tags
Deprecated.
|
private DBObject |
GroupCommand.condition |
private DBObject |
WriteConcernError.details |
private DBObject |
BulkWriteError.details |
private DBObject |
InsertRequest.document |
private DBObject |
Update.filter |
private DBObject |
Remove.filter |
private DBObject |
QueryOpBuilder.hintObj |
private DBObject |
GroupCommand.initial |
private DBObject |
GroupCommand.keys |
private DBObject |
QueryOpBuilder.orderBy |
private DBObject |
BulkUpdateRequestBuilder.query |
private DBObject |
QueryOpBuilder.query |
private DBObject |
ModifyRequest.query |
private DBObject |
BulkWriteRequestBuilder.query |
private DBObject |
DBPort.ActiveState.query |
private DBObject |
RemoveRequest.query |
private DBObject |
QueryOpBuilder.specialFields |
private DBObject |
ModifyRequest.updateDocument |
private DBObject |
Update.updateOperations |
| Modifier and Type | Field and Description |
|---|---|
private java.util.ArrayList<DBObject> |
DBCursor._all |
private java.util.Iterator<DBObject> |
QueryResultIterator._cur |
protected java.util.List<DBObject> |
DBCollection._hintFields
Deprecated.
Please use
DBCollection.setHintFields(java.util.List) and DBCollection.getHintFields() instead. |
(package private) java.util.List<DBObject> |
Response._objects |
protected java.lang.Iterable<DBObject> |
AggregationOutput._resultSet
Deprecated.
Please use
AggregationOutput.results() instead. |
(package private) java.lang.Iterable<DBObject> |
MapReduceOutput._resultSet |
private java.util.LinkedList<DBObject> |
BasicDBObjectBuilder._stack |
private java.util.List<DBObject> |
InsertCommandMessage.documents |
| Modifier and Type | Method and Description |
|---|---|
protected DBObject |
DBCollection._checkObject(DBObject o,
boolean canBeNull,
boolean query)
Deprecated.
This method should not be a part of API.
If you override one of the
DBCollection methods please rely on superclass
implementation in checking argument correctness and validity. |
private DBObject |
DefaultDBCallback._create(java.util.List<java.lang.String> path) |
private DBObject |
BasicDBObjectBuilder._cur() |
private DBObject |
DBCursor._next() |
DBObject |
DBCursor.curr()
Returns the element the cursor is at.
|
(package private) DBObject |
DefaultDBCallback.dbget() |
DBObject |
LazyDBDecoder.decode(byte[] b,
DBCollection collection) |
DBObject |
DefaultDBDecoder.decode(byte[] b,
DBCollection collection) |
DBObject |
DBDecoder.decode(byte[] bytes,
DBCollection collection)
Decode a single DBObject belonging to the given collection from the given array of bytes.
|
DBObject |
LazyDBDecoder.decode(java.io.InputStream in,
DBCollection collection) |
DBObject |
DefaultDBDecoder.decode(java.io.InputStream in,
DBCollection collection) |
DBObject |
DBDecoder.decode(java.io.InputStream input,
DBCollection collection)
Decode a single DBObject belonging to the given collection from the given input stream.
|
(package private) DBObject |
DBCollection.defaultOptions(DBObject keys) |
DBObject |
DBCursor.explain()
Returns an object containing basic information about the execution of the query that created this cursor.
|
DBObject |
DBRefBase.fetch()
Deprecated.
use
DBCollection.findOne(Object) instead |
static DBObject |
DBRef.fetch(DB db,
DBObject ref)
Deprecated.
use
DBCollection.findOne(Object) instead |
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject update)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject sort,
DBObject update)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
protected abstract DBObject |
DBCollection.findAndModifyImpl(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
java.lang.Boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
protected DBObject |
DBCollectionImpl.findAndModifyImpl(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
java.lang.Boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern) |
DBObject |
DBCollection.findAndRemove(DBObject query)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findOne()
Returns a single object from this collection.
|
DBObject |
DBCollection.findOne(DBObject o)
Returns a single object from this collection matching the query.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields)
Returns a single object from this collection matching the query.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
DBObject orderBy)
Returns a single object from this collection matching the query.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
DBObject orderBy,
ReadPreference readPref)
Get a single document from collection.
|
(package private) DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
DBObject orderBy,
ReadPreference readPref,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit)
Get a single document from collection.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
ReadPreference readPref)
Get a single document from collection.
|
DBObject |
DBCollection.findOne(java.lang.Object id)
Get a single document from collection by '_id'.
|
DBObject |
DBCollection.findOne(java.lang.Object id,
DBObject projection)
Get a single document from collection by '_id'.
|
DBObject |
QueryOpBuilder.get()
Constructs the query operation DBObject
|
DBObject |
QueryBuilder.get()
Creates a
DBObject query to be used for the driver's find operations |
DBObject |
BasicDBObjectBuilder.get()
Gets the top level document.
|
DBObject |
Response.get(int i) |
private DBObject |
DBPort.X509Authenticator.getAuthCommand() |
(package private) static DBObject |
NativeAuthenticationHelper.getAuthCommand(java.lang.String userName,
byte[] authHash,
java.lang.String nonce) |
(package private) static DBObject |
NativeAuthenticationHelper.getAuthCommand(java.lang.String userName,
char[] password,
java.lang.String nonce) |
DBObject |
AggregationOutput.getCommand()
Deprecated.
there is no replacement for this method
|
DBObject |
MapReduceOutput.getCommand()
Get the original command that was sent to the database.
|
DBObject |
WriteConcernError.getDetails()
Gets the details associated with this error.
|
DBObject |
BulkWriteError.getDetails()
Gets the details associated with this error.
|
DBObject |
InsertRequest.getDocument() |
DBObject |
ReplaceRequest.getDocument() |
private static DBObject |
WriteCommandResultHelper.getErrInfo(DBObject response) |
private DBObject |
DBCollectionImpl.Run.RunExecutor.getErrorResponseDetails(DBObject response) |
DBObject |
MapReduceCommand.getExtraOptions()
Deprecated.
use the specific field getter methods
|
(package private) DBObject |
Update.getFilter() |
DBObject |
Remove.getFilter() |
DBObject |
DBCursor.getKeysWanted()
Gets the fields to be returned.
|
(package private) DBObject |
OutMessage.getQuery() |
DBObject |
ModifyRequest.getQuery() |
DBObject |
MapReduceCommand.getQuery()
Gets the query to run for this MapReduce job
|
DBObject |
DBCursor.getQuery()
Gets the query.
|
(package private) DBObject |
DBPort.ActiveState.getQuery() |
DBObject |
RemoveRequest.getQuery() |
private DBObject[] |
ReadPreference.TaggedReadPreference.getRemainingMaps(java.util.List<DBObject> maps)
Deprecated.
|
DBObject |
MapReduceCommand.getSort()
Gets the (optional) sort specification object
|
DBObject |
ReadPreference.TaggedReadPreference.getTags()
Deprecated.
|
private DBObject |
MongoClientURI.getTagSet(java.lang.String tagSetString) |
DBObject |
UpdateRequest.getUpdate() |
DBObject |
ModifyRequest.getUpdateDocument() |
DBObject |
Update.getUpdateOperations() |
private DBObject |
DBApiLayer.getUserCommandDocument(java.lang.String username,
char[] passwd,
boolean readOnly,
java.lang.String commandName)
Deprecated.
|
DBObject |
DBCollection.group(DBObject args)
Deprecated.
use
DBCollection.group(com.mongodb.GroupCommand) instead. This method will be removed in 3.0 |
DBObject |
DBCollection.group(DBObject key,
DBObject cond,
DBObject initial,
java.lang.String reduce)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
DBObject |
DBCollection.group(DBObject key,
DBObject cond,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
DBObject |
DBCollection.group(DBObject key,
DBObject cond,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize,
ReadPreference readPrefs)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
DBObject |
DBCollection.group(GroupCommand cmd)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
DBObject |
DBCollection.group(GroupCommand cmd,
ReadPreference readPrefs)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
private DBObject |
DBCollection.instantiateObjectClassInstance() |
DBObject |
QueryResultIterator.next() |
DBObject |
DBCursor.next()
Returns the object the cursor is at and moves the cursor ahead by one.
|
DBObject |
DBCursor.one()
Returns the first document that matches the query.
|
(package private) DBObject |
DBCollection.prepareAggregationCommand(java.util.List<DBObject> pipeline,
AggregationOptions options,
ServerVersion serverVersion) |
(package private) DBObject |
DBCollection.replaceWithObjectClass(DBObject oldObj)
Doesn't yet handle internal classes properly, so this method only does something if object class is set but
no internal classes are set.
|
abstract DBObject |
ReadPreference.toDBObject()
Deprecated.
for internal use only
|
DBObject |
ReadPreference.PrimaryReadPreference.toDBObject() |
DBObject |
ReadPreference.TaggedReadPreference.toDBObject()
Deprecated.
|
DBObject |
GroupCommand.toDBObject()
Turns this group command into the DBObject format of the command.
|
DBObject |
MapReduceCommand.toDBObject()
Turns this command into a DBObject representation of this map reduce command.
|
DBObject |
TaggableReadPreference.toDBObject()
Deprecated.
|
DBObject |
DBCursor.tryNext()
Non blocking check for tailable cursors to see if another object is available.
|
DBObject |
Mongo.unlock()
Unlocks the database, allowing the write operations to go through.
|
(package private) DBObject |
DB.wrapCommand(DBObject cmd,
ReadPreference readPreference) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<DBObject> |
DBCollection.getHintFields()
Get hint fields for this collection (used to optimize queries).
|
abstract java.util.List<DBObject> |
DBCollection.getIndexInfo()
Return a list of the indexes for this collection.
|
java.util.List<DBObject> |
DBCollectionImpl.getIndexInfo() |
java.util.List<DBObject> |
TaggableReadPreference.getTagSets()
Deprecated.
use the
getTagSetList method instead |
java.util.Iterator<DBObject> |
DBCursor.iterator()
Creates a copy of this cursor object that can be iterated.
|
java.util.Iterator<DBObject> |
Response.iterator() |
java.lang.Iterable<DBObject> |
AggregationOutput.results()
Returns an iterator to the results of the aggregation
|
java.lang.Iterable<DBObject> |
MapReduceOutput.results()
Returns an iterable containing the results of the operation.
|
private static java.util.List<DBObject> |
ReadPreference.TaggedReadPreference.splitMapIntoMultipleMaps(DBObject tags)
Deprecated.
|
java.util.List<DBObject> |
DBCursor.toArray()
Converts this cursor to an array.
|
java.util.List<DBObject> |
DBCursor.toArray(int max)
Converts this cursor to an array.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
DBCollection._checkKeys(DBObject o)
Checks key strings for invalid characters.
|
protected DBObject |
DBCollection._checkObject(DBObject o,
boolean canBeNull,
boolean query)
Deprecated.
This method should not be a part of API.
If you override one of the
DBCollection methods please rely on superclass
implementation in checking argument correctness and validity. |
QueryOpBuilder |
QueryOpBuilder.addHint(DBObject hint)
Adds hint clause to the operation
|
QueryOpBuilder |
QueryOpBuilder.addOrderBy(DBObject orderBy)
Adds the orderby clause to the operation
|
QueryOpBuilder |
QueryOpBuilder.addQuery(DBObject query)
Adds the query clause to the operation
|
QueryOpBuilder |
QueryOpBuilder.addSpecialFields(DBObject specialFields)
Adds special fields to the operation
|
private void |
QueryOpBuilder.addToQueryObject(DBObject dbobj,
java.lang.String field,
DBObject obj,
boolean sendEmpty)
Adds DBObject to the operation
|
private void |
QueryOpBuilder.addToQueryObject(DBObject dbobj,
java.lang.String field,
java.lang.Object obj)
Adds an Object to the operation
|
AggregationOutput |
DBCollection.aggregate(DBObject firstOp,
DBObject... additionalOps)
Deprecated.
Use
DBCollection.aggregate(java.util.List) instead |
AggregationOutput |
DBCollection.aggregate(DBObject firstOp,
DBObject... additionalOps)
Deprecated.
Use
DBCollection.aggregate(java.util.List) instead |
QueryBuilder |
QueryBuilder.and(DBObject... ands)
Equivalent to an $and operand
|
java.lang.Object |
DBCollection.apply(DBObject document)
Deprecated.
This method will be removed in a future release. There is no replacement.
|
java.lang.Object |
DBCollection.apply(DBObject document,
boolean ensureId)
Deprecated.
This method will be removed in a future release. There is no replacement.
|
private ReadPreference |
MongoClientURI.buildReadPreference(java.lang.String readPreferenceType,
DBObject firstTagSet,
java.util.List<DBObject> remainingTagSets,
java.lang.Boolean slaveOk) |
CommandResult |
DB.command(DBObject cmd)
Executes a database command.
|
CommandResult |
DB.command(DBObject cmd,
DBEncoder encoder)
Executes a database command.
|
CommandResult |
DB.command(DBObject cmd,
int options)
Deprecated.
Use
DB.command(DBObject, ReadPreference) instead. This method will be removed in 3.0. |
CommandResult |
DB.command(DBObject cmd,
int options,
DBEncoder encoder)
Deprecated.
Use
DB.command(DBObject, ReadPreference, DBEncoder) instead. This method will be removed in 3.0. |
(package private) CommandResult |
DBCollection.command(DBObject cmd,
int options,
ReadPreference readPrefs) |
CommandResult |
DB.command(DBObject cmd,
int options,
ReadPreference readPreference)
Deprecated.
Use
DB.command(DBObject, ReadPreference) instead. This method will be removed in 3.0. |
CommandResult |
DB.command(DBObject cmd,
int options,
ReadPreference readPreference,
DBEncoder encoder)
Deprecated.
Use
DB.command(DBObject, ReadPreference, DBEncoder) instead. This method will be removed in 3.0. |
CommandResult |
DB.command(DBObject cmd,
ReadPreference readPreference)
Executes the command against the database with the given read preference.
|
CommandResult |
DB.command(DBObject cmd,
ReadPreference readPreference,
DBEncoder encoder)
Executes a database command with the selected readPreference, and encodes the command using the given encoder.
|
private CommandResult |
DBPort.convertToCommandResult(DBObject cmd,
Response res)
Deprecated.
|
long |
DBCollection.count(DBObject query)
Get the count of documents in collection that would match a criteria.
|
long |
DBCollection.count(DBObject query,
ReadPreference readPrefs)
Get the count of documents in collection that would match a criteria.
|
DBCollection |
DB.createCollection(java.lang.String name,
DBObject options)
Creates a collection with a given name and options.
|
void |
DBCollection.createIndex(DBObject keys)
Forces creation of an index on a set of fields with the default options, if one does not already exist.
|
void |
DBCollection.createIndex(DBObject keys,
DBObject options)
Forces creation of an index on a set of fields, if one does not already exist.
|
abstract void |
DBCollection.createIndex(DBObject keys,
DBObject options,
DBEncoder encoder)
Deprecated.
use
DBCollection.createIndex(DBObject, com.mongodb.DBObject) the encoder is not used. |
void |
DBCollectionImpl.createIndex(DBObject keys,
DBObject options,
DBEncoder encoder) |
void |
DBCollection.createIndex(DBObject keys,
java.lang.String name)
Forces creation of an index on a set of fields, if one does not already exist.
|
void |
DBCollection.createIndex(DBObject keys,
java.lang.String name,
boolean unique)
Forces creation of an index on a set of fields, if one does not already exist.
|
(package private) DBObject |
DBCollection.defaultOptions(DBObject keys) |
java.util.List |
DBCollection.distinct(java.lang.String key,
DBObject query)
Find the distinct values for a specified field across a collection and returns the results in an array.
|
java.util.List |
DBCollection.distinct(java.lang.String key,
DBObject query,
ReadPreference readPrefs)
Find the distinct values for a specified field across a collection and returns the results in an array.
|
protected abstract void |
DBCollection.doapply(DBObject document)
Deprecated.
This method will be removed in a future release. There is no replacement.
|
void |
DBCollectionImpl.doapply(DBObject o) |
void |
DBCollection.dropIndex(DBObject keys)
Drops an index from this collection.
|
QueryBuilder |
QueryBuilder.elemMatch(DBObject match)
Equivalent to the $elemMatch operand
|
void |
BSONBinaryWriter.encodeDocument(DBEncoder encoder,
DBObject dbObject) |
void |
DBCollection.ensureIndex(DBObject keys)
Deprecated.
use
DBCollection.createIndex(DBObject) instead |
void |
DBCollection.ensureIndex(DBObject keys,
DBObject optionsIN)
Deprecated.
use
DBCollection.createIndex(DBObject, DBObject) instead |
void |
DBCollection.ensureIndex(DBObject keys,
java.lang.String name)
Deprecated.
use
DBCollection.createIndex(DBObject, DBObject) instead |
void |
DBCollection.ensureIndex(DBObject keys,
java.lang.String name,
boolean unique)
Deprecated.
|
static DBObject |
DBRef.fetch(DB db,
DBObject ref)
Deprecated.
use
DBCollection.findOne(Object) instead |
DBCursor |
DBCollection.find(DBObject ref)
Queries for an object in this collection.
|
BulkWriteRequestBuilder |
BulkWriteOperation.find(DBObject query)
Start building a write request to add to the bulk write operation.
|
DBCursor |
DBCollection.find(DBObject ref,
DBObject keys)
Queries for an object in this collection.
|
DBCursor |
DBCollection.find(DBObject query,
DBObject fields,
int numToSkip,
int batchSize)
Deprecated.
use
DBCursor.skip(int) and DBCursor.batchSize(int) on the DBCursor
returned from DBCollection.find(DBObject, DBObject) |
DBCursor |
DBCollection.find(DBObject query,
DBObject fields,
int numToSkip,
int batchSize,
int options)
Deprecated.
use
DBCursor.skip(int), DBCursor.batchSize(int) and DBCursor.setOptions(int) on the DBCursor returned from DBCollection.find(DBObject,
DBObject) |
(package private) abstract QueryResultIterator |
DBCollection.find(DBObject ref,
DBObject fields,
int numToSkip,
int batchSize,
int limit,
int options,
ReadPreference readPref,
DBDecoder decoder)
Finds objects
|
(package private) QueryResultIterator |
DBCollectionImpl.find(DBObject ref,
DBObject fields,
int numToSkip,
int batchSize,
int limit,
int options,
ReadPreference readPref,
DBDecoder decoder) |
(package private) abstract QueryResultIterator |
DBCollection.find(DBObject ref,
DBObject fields,
int numToSkip,
int batchSize,
int limit,
int options,
ReadPreference readPref,
DBDecoder decoder,
DBEncoder encoder) |
(package private) QueryResultIterator |
DBCollectionImpl.find(DBObject ref,
DBObject fields,
int numToSkip,
int batchSize,
int limit,
int options,
ReadPreference readPref,
DBDecoder decoder,
DBEncoder encoder) |
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject update)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject sort,
DBObject update)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
protected abstract DBObject |
DBCollection.findAndModifyImpl(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
java.lang.Boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
protected DBObject |
DBCollectionImpl.findAndModifyImpl(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
java.lang.Boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern) |
DBObject |
DBCollection.findAndRemove(DBObject query)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findOne(DBObject o)
Returns a single object from this collection matching the query.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields)
Returns a single object from this collection matching the query.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
DBObject orderBy)
Returns a single object from this collection matching the query.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
DBObject orderBy,
ReadPreference readPref)
Get a single document from collection.
|
(package private) DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
DBObject orderBy,
ReadPreference readPref,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit)
Get a single document from collection.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
ReadPreference readPref)
Get a single document from collection.
|
DBObject |
DBCollection.findOne(java.lang.Object id,
DBObject projection)
Get a single document from collection by '_id'.
|
static java.lang.String |
DBCollection.genIndexName(DBObject keys)
Deprecated.
This method is NOT a part of public API and will be dropped in 3.x versions.
|
(package private) ReadPreference |
DB.getCommandReadPreference(DBObject command,
ReadPreference requestedPreference)
Determines the read preference that should be used for the given command.
|
long |
DBCollection.getCount(DBObject query)
Get the count of documents in collection that would match a criteria.
|
long |
DBCollection.getCount(DBObject query,
DBObject fields)
Get the count of documents in collection that would match a criteria.
|
long |
DBCollection.getCount(DBObject query,
DBObject fields,
long limit,
long skip)
Get the count of documents in collection that would match a criteria.
|
long |
DBCollection.getCount(DBObject query,
DBObject fields,
long limit,
long skip,
ReadPreference readPrefs)
Get the count of documents in collection that would match a criteria.
|
(package private) long |
DBCollection.getCount(DBObject query,
DBObject fields,
long limit,
long skip,
ReadPreference readPrefs,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit) |
(package private) long |
DBCollection.getCount(DBObject query,
DBObject fields,
long limit,
long skip,
ReadPreference readPrefs,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
java.lang.Object hint) |
long |
DBCollection.getCount(DBObject query,
DBObject fields,
ReadPreference readPrefs)
Get the count of documents in collection that would match a criteria.
|
private static DBObject |
WriteCommandResultHelper.getErrInfo(DBObject response) |
private DBObject |
DBCollectionImpl.Run.RunExecutor.getErrorResponseDetails(DBObject response) |
private static TagSet |
ServerMonitor.getTagSetFromDocument(DBObject tagsDocument) |
DBObject |
DBCollection.group(DBObject args)
Deprecated.
use
DBCollection.group(com.mongodb.GroupCommand) instead. This method will be removed in 3.0 |
DBObject |
DBCollection.group(DBObject key,
DBObject cond,
DBObject initial,
java.lang.String reduce)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
DBObject |
DBCollection.group(DBObject key,
DBObject cond,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
DBObject |
DBCollection.group(DBObject key,
DBObject cond,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize,
ReadPreference readPrefs)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
DBCursor |
DBCursor.hint(DBObject indexKeys)
Informs the database of indexed fields of the collection in order to improve performance.
|
private void |
QueryResultIterator.initFromCursorDocument(DBObject cursorDocument,
Mongo mongo) |
WriteResult |
DBCollection.insert(DBObject... arr)
Insert documents into a collection.
|
void |
BulkWriteOperation.insert(DBObject document)
Add an insert request to the bulk operation
|
WriteResult |
DBCollection.insert(DBObject[] arr,
WriteConcern concern)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(DBObject[] arr,
WriteConcern concern,
DBEncoder encoder)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(DBObject o,
WriteConcern concern)
Insert a document into a collection.
|
WriteResult |
DBCollection.insert(WriteConcern concern,
DBObject... arr)
Insert documents into a collection.
|
MapReduceOutput |
DBCollection.mapReduce(DBObject command)
Deprecated.
Use
DBCollection.mapReduce(MapReduceCommand) instead |
MapReduceOutput |
DBCollection.mapReduce(java.lang.String map,
java.lang.String reduce,
java.lang.String outputTarget,
DBObject query)
Allows you to run map-reduce aggregation operations over a collection.
|
MapReduceOutput |
DBCollection.mapReduce(java.lang.String map,
java.lang.String reduce,
java.lang.String outputTarget,
MapReduceCommand.OutputType outputType,
DBObject query)
Allows you to run map-reduce aggregation operations over a collection and saves to a named collection.
|
MapReduceOutput |
DBCollection.mapReduce(java.lang.String map,
java.lang.String reduce,
java.lang.String outputTarget,
MapReduceCommand.OutputType outputType,
DBObject query,
ReadPreference readPrefs)
Allows you to run map-reduce aggregation operations over a collection and saves to a named collection.
|
DBCursor |
DBCursor.max(DBObject max)
Specifies an exclusive upper limit for the index to use in a query.
|
DBCursor |
DBCursor.min(DBObject min)
Specifies an inclusive lower limit for the index to use in a query.
|
static TaggableReadPreference |
ReadPreference.nearest(DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use factory methods that take
TagSet instead |
static TaggableReadPreference |
ReadPreference.nearest(DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use factory methods that take
TagSet instead |
QueryBuilder |
QueryBuilder.or(DBObject... ors)
Equivalent to an $or operand
|
private BasicDBObject |
DBCollectionImpl.prepareFindAndModifyCommand(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
java.lang.Boolean bypassDocumentValidation,
long maxTime,
java.util.concurrent.TimeUnit maxTimeUnit,
WriteConcern writeConcern,
ServerVersion serverVersion) |
static TaggableReadPreference |
ReadPreference.primaryPreferred(DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use factory methods that take
TagSet instead |
static TaggableReadPreference |
ReadPreference.primaryPreferred(DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use factory methods that take
TagSet instead |
(package private) static OutMessage |
OutMessage.query(DBCollection collection,
int options,
int numToSkip,
int batchSize,
DBObject query,
DBObject fields,
int maxBSONObjectSize) |
(package private) static OutMessage |
OutMessage.query(DBCollection collection,
int options,
int numToSkip,
int batchSize,
DBObject query,
DBObject fields,
ReadPreference readPref,
DBEncoder enc) |
(package private) static OutMessage |
OutMessage.query(DBCollection collection,
int options,
int numToSkip,
int batchSize,
DBObject query,
DBObject fields,
ReadPreference readPref,
DBEncoder enc,
int maxBSONObjectSize) |
static OutMessage |
OutMessage.remove(DBCollection collection,
DBEncoder encoder,
DBObject query,
boolean multi) |
WriteResult |
DBCollection.remove(DBObject o)
Remove documents from a collection.
|
WriteResult |
DBCollectionImpl.remove(DBObject query,
boolean multi,
WriteConcern concern,
DBEncoder encoder) |
WriteResult |
DBCollection.remove(DBObject o,
WriteConcern concern)
Remove documents from a collection.
|
abstract WriteResult |
DBCollection.remove(DBObject o,
WriteConcern concern,
DBEncoder encoder)
Remove documents from a collection.
|
WriteResult |
DBCollectionImpl.remove(DBObject query,
WriteConcern concern,
DBEncoder encoder) |
void |
BulkUpdateRequestBuilder.replaceOne(DBObject document)
Adds a request to replace one document in the collection that matches the query with which this builder was created.
|
void |
BulkWriteRequestBuilder.replaceOne(DBObject document)
Adds a request to replace one document in the collection that matches the query with which this builder was created.
|
(package private) DBObject |
DBCollection.replaceWithObjectClass(DBObject oldObj)
Doesn't yet handle internal classes properly, so this method only does something if object class is set but
no internal classes are set.
|
(package private) CommandResult |
DBPort.runCommand(DB db,
DBObject cmd)
Deprecated.
|
(package private) CommandResult |
DBPort.runCommand(DB db,
DBObject cmd,
int maxBsonObjectSize)
Deprecated.
|
(package private) CommandResult |
DBPort.runCommand(DB db,
DBObject cmd,
ReadPreference readPreference,
int maxBsonObjectSize)
Deprecated.
|
WriteResult |
DBCollection.save(DBObject jo)
Update an existing document or insert a document depending on the parameter.
|
WriteResult |
DBCollection.save(DBObject jo,
WriteConcern concern)
Update an existing document or insert a document depending on the parameter.
|
static TaggableReadPreference |
ReadPreference.secondary(DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use factory methods that take
TagSet instead |
static TaggableReadPreference |
ReadPreference.secondary(DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use factory methods that take
TagSet instead |
static TaggableReadPreference |
ReadPreference.secondaryPreferred(DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use factory methods that take
TagSet instead |
static TaggableReadPreference |
ReadPreference.secondaryPreferred(DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use factory methods that take
TagSet instead |
void |
MapReduceCommand.setSort(DBObject sort)
Sets the (optional) sort specification object
|
DBCursor |
DBCursor.sort(DBObject orderBy)
Sorts this cursor's elements.
|
private static java.util.List<DBObject> |
ReadPreference.TaggedReadPreference.splitMapIntoMultipleMaps(DBObject tags)
Deprecated.
|
private static TagSet |
ReadPreference.toTags(DBObject tagsDocument) |
private static java.util.List<TagSet> |
ReadPreference.toTagsList(DBObject firstTagSet,
DBObject... remainingTagSets) |
private static java.util.List<TagSet> |
ReadPreference.toTagsList(DBObject firstTagSet,
DBObject... remainingTagSets) |
static OutMessage |
OutMessage.update(DBCollection collection,
DBEncoder encoder,
boolean upsert,
boolean multi,
DBObject query,
DBObject o) |
void |
BulkUpdateRequestBuilder.update(DBObject update)
Adds a request to update all documents in the collection that match the query with which this builder was created.
|
void |
BulkWriteRequestBuilder.update(DBObject update)
Adds a request to update all documents in the collection that match the query with which this builder was created.
|
WriteResult |
DBCollection.update(DBObject q,
DBObject o)
Modify an existing document or documents in collection.
|
WriteResult |
DBCollection.update(DBObject q,
DBObject o,
boolean upsert,
boolean multi)
Modify an existing document or documents in collection.
|
WriteResult |
DBCollection.update(DBObject q,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern)
Modify an existing document or documents in collection.
|
WriteResult |
DBCollection.update(DBObject q,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern,
boolean bypassDocumentValidation,
DBEncoder encoder)
Modify an existing document or documents in collection.
|
WriteResult |
DBCollection.update(DBObject q,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern,
DBEncoder encoder)
Modify an existing document or documents in collection.
|
protected abstract WriteResult |
DBCollection.updateImpl(DBObject q,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern,
java.lang.Boolean bypassDocumentValidation,
DBEncoder encoder)
Modify an existing document or documents in collection.
|
protected WriteResult |
DBCollectionImpl.updateImpl(DBObject query,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern,
java.lang.Boolean bypassDocumentValidation,
DBEncoder encoder) |
WriteResult |
DBCollection.updateMulti(DBObject q,
DBObject o)
Modify documents in collection.
|
void |
BulkUpdateRequestBuilder.updateOne(DBObject update)
Adds a request to update one document in the collection that matches the query with which this builder was created.
|
void |
BulkWriteRequestBuilder.updateOne(DBObject update)
Adds a request to update one document in the collection that matches the query with which this builder was created.
|
static TaggableReadPreference |
ReadPreference.valueOf(java.lang.String name,
DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use method that takes a
List<TagSet> |
static TaggableReadPreference |
ReadPreference.valueOf(java.lang.String name,
DBObject firstTagSet,
DBObject... remainingTagSets)
Deprecated.
use method that takes a
List<TagSet> |
static ReadPreference |
ReadPreference.withTags(DBObject tags)
Deprecated.
As of release 2.9.0, replaced by
ReadPreference.secondaryPreferred(DBObject firstTagSet, DBObject... remainingTagSets) |
(package private) DBObject |
DB.wrapCommand(DBObject cmd,
ReadPreference readPreference) |
private void |
OutMessage.writeQuery(DBObject fields,
int numToSkip,
int batchSize) |
private void |
OutMessage.writeUpdate(boolean upsert,
boolean multi,
DBObject query,
DBObject o) |
| Modifier and Type | Method and Description |
|---|---|
AggregationOutput |
DBCollection.aggregate(java.util.List<DBObject> pipeline)
Method implements aggregation framework.
|
Cursor |
DBCollection.aggregate(java.util.List<DBObject> pipeline,
AggregationOptions options)
Method implements aggregation framework.
|
abstract Cursor |
DBCollection.aggregate(java.util.List<DBObject> pipeline,
AggregationOptions options,
ReadPreference readPreference)
Method implements aggregation framework.
|
Cursor |
DBCollectionImpl.aggregate(java.util.List<DBObject> pipeline,
AggregationOptions options,
ReadPreference readPreference) |
AggregationOutput |
DBCollection.aggregate(java.util.List<DBObject> pipeline,
ReadPreference readPreference)
Method implements aggregation framework.
|
private void |
DBCollectionImpl.applyRulesForInsert(java.util.List<DBObject> list) |
private ReadPreference |
MongoClientURI.buildReadPreference(java.lang.String readPreferenceType,
DBObject firstTagSet,
java.util.List<DBObject> remainingTagSets,
java.lang.Boolean slaveOk) |
CommandResult |
DBCollection.explainAggregate(java.util.List<DBObject> pipeline,
AggregationOptions options)
Return the explain plan for the aggregation pipeline.
|
private DBObject[] |
ReadPreference.TaggedReadPreference.getRemainingMaps(java.util.List<DBObject> maps)
Deprecated.
|
private void |
QueryResultIterator.init(int flags,
long cursorId,
int size,
java.util.Iterator<DBObject> iterator,
Mongo mongo) |
WriteResult |
DBCollection.insert(java.util.List<DBObject> list)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(java.util.List<DBObject> documents,
InsertOptions insertOptions)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(java.util.List<DBObject> list,
WriteConcern concern)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(java.util.List<DBObject> list,
WriteConcern concern,
DBEncoder encoder)
Insert documents into a collection.
|
protected abstract WriteResult |
DBCollection.insertImpl(java.util.List<DBObject> list,
WriteConcern concern,
DBEncoder encoder,
java.lang.Boolean bypassDocumentValidation)
Insert documents into a collection.
|
protected WriteResult |
DBCollectionImpl.insertImpl(java.util.List<DBObject> list,
WriteConcern concern,
DBEncoder encoder,
java.lang.Boolean bypassDocumentValidation) |
private BulkWriteResult |
DBCollectionImpl.insertWithCommandProtocol(java.util.List<DBObject> list,
WriteConcern writeConcern,
DBEncoder encoder,
DBPort port,
java.lang.Boolean bypassDocumentValidation) |
private WriteResult |
DBCollectionImpl.insertWithWriteProtocol(java.util.List<DBObject> list,
WriteConcern concern,
DBEncoder encoder,
DBPort port,
boolean shouldApply) |
(package private) DBObject |
DBCollection.prepareAggregationCommand(java.util.List<DBObject> pipeline,
AggregationOptions options,
ServerVersion serverVersion) |
void |
DBCollection.setHintFields(java.util.List<DBObject> indexes)
Override MongoDB's default index selection and query optimization process.
|
| Constructor and Description |
|---|
AggregationOutput(DBObject command,
CommandResult commandResult)
Deprecated.
there is no replacement for this constructor
|
BulkUpdateRequestBuilder(BulkWriteOperation bulkWriteOperation,
DBObject query,
boolean upsert) |
BulkWriteError(int code,
java.lang.String message,
DBObject details,
int index)
Constructs a new instance.
|
BulkWriteRequestBuilder(BulkWriteOperation bulkWriteOperation,
DBObject query) |
DBCursor(DBCollection collection,
DBObject q,
DBObject k,
ReadPreference preference)
Initializes a new database cursor.
|
DBPointer(DBObject parent,
java.lang.String fieldName,
DB db,
java.lang.String ns,
ObjectId id)
Deprecated.
|
GroupCommand(DBCollection collection,
DBObject keys,
DBObject condition,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize)
Creates a new group command.
|
GroupCommand(DBCollection collection,
java.lang.String keyf,
DBObject condition,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize)
Creates a new group command.
|
InsertRequest(DBObject document) |
MapReduceCommand(DBCollection inputCollection,
java.lang.String map,
java.lang.String reduce,
java.lang.String outputCollection,
MapReduceCommand.OutputType type,
DBObject query)
Represents the command for a map reduce operation Runs the command in REPLACE output type to a named collection
|
MapReduceOutput(DBCollection from,
DBObject cmd,
CommandResult raw)
Deprecated.
In the 3.0 version of the driver, this will be constructed only by the driver, and will therefore not have a public
constructor.
|
ModifyRequest(DBObject query,
boolean upsert,
DBObject updateDocument) |
OutMessage(DBCollection collection,
DBEncoder enc,
DBObject query,
int options,
ReadPreference readPref,
int maxBSONObjectSize) |
OutMessage(DBCollection collection,
Mongo m,
OutMessage.OpCode opCode,
DBEncoder enc,
DBObject query,
int options,
ReadPreference readPref,
int maxBSONObjectSize) |
OutMessage(DBCollection collection,
OutMessage.OpCode opCode,
DBEncoder enc,
DBObject query) |
QueryResultIterator(DBObject cursorDocument,
Mongo mongo,
int batchSize,
DBDecoder decoder,
ServerAddress serverAddress) |
Remove(DBObject filter) |
RemoveRequest(DBObject query,
boolean multi) |
ReplaceRequest(DBObject query,
boolean upsert,
DBObject document) |
ServerError(DBObject o)
Deprecated.
|
TaggedReadPreference(DBObject tags)
Deprecated.
|
Update(DBObject filter,
DBObject updateOperations) |
UpdateRequest(DBObject query,
boolean upsert,
DBObject update,
boolean multi) |
WriteConcernError(int code,
java.lang.String message,
DBObject details)
Constructs a new instance.
|
| Constructor and Description |
|---|
InsertCommandMessage(MongoNamespace namespace,
WriteConcern writeConcern,
java.lang.Boolean bypassDocumentValidation,
java.util.List<DBObject> documents,
DBEncoder commandEncoder,
DBEncoder encoder,
MessageSettings settings) |
| Modifier and Type | Class and Description |
|---|---|
class |
GridFSDBFile
This class enables retrieving a GridFS file metadata and content.
|
class |
GridFSFile
The abstract class representing a GridFS file.
|
class |
GridFSInputFile
This class represents a GridFS file to be written to the database.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) DBObject |
GridFSFile._extradata |
| Modifier and Type | Method and Description |
|---|---|
protected DBObject |
GridFSInputFile.createChunk(java.lang.Object id,
int currentChunkNumber,
byte[] writeBuffer)
Creates a new chunk of this file.
|
DBObject |
GridFSFile.getMetaData()
Gets the file metadata.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<GridFSDBFile> |
GridFS.find(DBObject query)
Finds a list of files matching the given query.
|
java.util.List<GridFSDBFile> |
GridFS.find(DBObject query,
DBObject sort)
Finds a list of files matching the given query.
|
java.util.List<GridFSDBFile> |
GridFS.find(java.lang.String filename,
DBObject sort)
Finds a list of files matching the given filename.
|
GridFSDBFile |
GridFS.findOne(DBObject query)
Finds one file matching the given query.
|
DBCursor |
GridFS.getFileList(DBObject query)
Gets a filtered list of files stored in this gridfs, sorted by filename.
|
DBCursor |
GridFS.getFileList(DBObject query,
DBObject sort)
Gets a sorted, filtered list of files stored in this gridfs.
|
void |
GridFS.remove(DBObject query)
Removes all files matching the given query.
|
void |
GridFSFile.setMetaData(DBObject metadata)
Gets the file metadata.
|
| Modifier and Type | Class and Description |
|---|---|
class |
LazyDBList
Deprecated.
Please use
LazyDBList instead. |