Package | Description |
---|---|
com.mongodb |
This package is the main entry point to the MongoDB Java Driver, and it contains the classes for the existing API from 2.x versions.
|
com.mongodb.bulk |
Contains classes for representing the result of a bulk write operation.
|
com.mongodb.connection |
Contains classes that manage connecting to MongoDB servers.
|
com.mongodb.event |
This package contains cluster and connection event related classes
|
com.mongodb.internal.authentication | |
com.mongodb.operation |
The core of the MongoDB driver works via operations, using the command pattern.
|
org.bson |
This package contains bson classes required for the driver
|
org.bson.codecs |
This package contains all the default BSON codecs.
|
org.bson.conversions |
This package contains the Bson interface
|
Modifier and Type | Method and Description |
---|---|
BsonDocument |
WriteConcern.asDocument()
Gets this write concern as a document.
|
BsonDocument |
ReadConcern.asDocument()
Gets this read concern as a document.
|
BsonDocument |
WriteError.getDetails()
Gets the details associated with this error.
|
BsonDocument |
WriteConcernException.getResponse()
Gets the response to the write operation.
|
BsonDocument |
MongoCommandException.getResponse()
For internal use only.
|
<TDocument> |
BasicDBObject.toBsonDocument(Class<TDocument> documentClass,
CodecRegistry codecRegistry) |
abstract BsonDocument |
ReadPreference.toDocument()
Gets a document representing this read preference in the wire protocol.
|
BsonDocument |
TaggableReadPreference.toDocument() |
Modifier and Type | Method and Description |
---|---|
static int |
WriteConcernException.extractErrorCode(BsonDocument response)
For internal use only: extract the error code from the response to a getlasterror command.
|
static String |
WriteConcernException.extractErrorMessage(BsonDocument response)
For internal use only: extract the error message from the response to a getlasterror command.
|
Constructor and Description |
---|
DuplicateKeyException(BsonDocument response,
ServerAddress address,
WriteConcernResult writeConcernResult)
Construct an instance.
|
MongoCommandException(BsonDocument response,
ServerAddress address)
Construct a new instance with the CommandResult from a failed command
|
WriteConcernException(BsonDocument response,
ServerAddress address,
WriteConcernResult writeConcernResult)
Construct a new instance.
|
WriteError(int code,
String message,
BsonDocument details)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
BsonDocument |
WriteConcernError.getDetails()
Gets the details associated with this error.
|
BsonDocument |
InsertRequest.getDocument()
Gets the document to insert.
|
BsonDocument |
UpdateRequest.getFilter()
Gets the query filter for the update.
|
BsonDocument |
DeleteRequest.getFilter()
Gets the query Object filter.
|
BsonDocument |
IndexRequest.getKeys()
Gets the index keys
|
BsonDocument |
IndexRequest.getPartialFilterExpression()
Get the filter expression for the documents to be included in the index or null if not set
|
BsonDocument |
IndexRequest.getStorageEngine()
Gets the storage engine options document for this index.
|
BsonDocument |
UpdateRequest.getUpdate()
Gets the update.
|
BsonDocument |
IndexRequest.getWeights()
Gets the weighting object for use with a text index
|
Modifier and Type | Method and Description |
---|---|
IndexRequest |
IndexRequest.partialFilterExpression(BsonDocument partialFilterExpression)
Sets the filter expression for the documents to be included in the index
|
IndexRequest |
IndexRequest.storageEngine(BsonDocument storageEngineOptions)
Sets the storage engine options document for this index.
|
IndexRequest |
IndexRequest.weights(BsonDocument weights)
Sets the weighting object for use with a text index.
|
Constructor and Description |
---|
BulkWriteError(int code,
String message,
BsonDocument details,
int index)
Constructs a new instance.
|
DeleteRequest(BsonDocument filter)
Construct a new instance.
|
IndexRequest(BsonDocument keys)
Construct a new instance with the given keys
|
InsertRequest(BsonDocument document)
Construct an instance with the given document.
|
UpdateRequest(BsonDocument filter,
BsonDocument update,
WriteRequest.Type updateType)
Construct a new instance.
|
WriteConcernError(int code,
String message,
BsonDocument details)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
Connection.command(String database,
BsonDocument command,
boolean slaveOk,
FieldNameValidator fieldNameValidator,
Decoder<T> commandResultDecoder)
Execute the command.
|
<T> void |
AsyncConnection.commandAsync(String database,
BsonDocument command,
boolean slaveOk,
FieldNameValidator fieldNameValidator,
Decoder<T> commandResultDecoder,
SingleResultCallback<T> callback)
Execute the command asynchronously.
|
<T> QueryResult<T> |
Connection.query(MongoNamespace namespace,
BsonDocument queryDocument,
BsonDocument fields,
int numberToReturn,
int skip,
boolean slaveOk,
boolean tailableCursor,
boolean awaitData,
boolean noCursorTimeout,
boolean partial,
boolean oplogReplay,
Decoder<T> resultDecoder)
|
<T> QueryResult<T> |
Connection.query(MongoNamespace namespace,
BsonDocument queryDocument,
BsonDocument fields,
int skip,
int limit,
int batchSize,
boolean slaveOk,
boolean tailableCursor,
boolean awaitData,
boolean noCursorTimeout,
boolean partial,
boolean oplogReplay,
Decoder<T> resultDecoder)
Execute the query.
|
<T> void |
AsyncConnection.queryAsync(MongoNamespace namespace,
BsonDocument queryDocument,
BsonDocument fields,
int numberToReturn,
int skip,
boolean slaveOk,
boolean tailableCursor,
boolean awaitData,
boolean noCursorTimeout,
boolean partial,
boolean oplogReplay,
Decoder<T> resultDecoder,
SingleResultCallback<QueryResult<T>> callback)
|
<T> void |
AsyncConnection.queryAsync(MongoNamespace namespace,
BsonDocument queryDocument,
BsonDocument fields,
int skip,
int limit,
int batchSize,
boolean slaveOk,
boolean tailableCursor,
boolean awaitData,
boolean noCursorTimeout,
boolean partial,
boolean oplogReplay,
Decoder<T> resultDecoder,
SingleResultCallback<QueryResult<T>> callback)
Execute the query asynchronously.
|
Modifier and Type | Method and Description |
---|---|
BsonDocument |
CommandStartedEvent.getCommand()
Gets the command document.
|
BsonDocument |
CommandSucceededEvent.getResponse()
Gets the response document.
|
Constructor and Description |
---|
CommandStartedEvent(int requestId,
ConnectionDescription connectionDescription,
String databaseName,
String commandName,
BsonDocument command)
Construct an instance.
|
CommandSucceededEvent(int requestId,
ConnectionDescription connectionDescription,
String commandName,
BsonDocument response,
long elapsedTimeNanos)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
static BsonDocument |
NativeAuthenticationHelper.getAuthCommand(String userName,
char[] password,
String nonce) |
static BsonDocument |
NativeAuthenticationHelper.getAuthCommand(String userName,
String authHash,
String nonce) |
static BsonDocument |
NativeAuthenticationHelper.getNonceCommand() |
Modifier and Type | Method and Description |
---|---|
BsonDocument |
CurrentOpOperation.execute(ReadBinding binding) |
BsonDocument |
FsyncUnlockOperation.execute(WriteBinding binding) |
BsonDocument |
CountOperation.getFilter()
Gets the query filter.
|
BsonDocument |
GroupOperation.getFilter()
Gets the query filter to determine which documents in the collection to process.
|
BsonDocument |
DistinctOperation.getFilter()
Gets the query filter.
|
BsonDocument |
FindAndDeleteOperation.getFilter()
Gets the query filter.
|
BsonDocument |
MapReduceToCollectionOperation.getFilter()
Gets the query filter.
|
BsonDocument |
ListCollectionsOperation.getFilter()
Gets the query filter.
|
BsonDocument |
FindAndUpdateOperation.getFilter()
Gets the query filter.
|
BsonDocument |
FindAndReplaceOperation.getFilter()
Gets the query filter.
|
BsonDocument |
FindOperation.getFilter()
Gets the query filter.
|
BsonDocument |
MapReduceWithInlineResultsOperation.getFilter()
Gets the query filter.
|
BsonDocument |
CreateCollectionOperation.getIndexOptionDefaults()
Gets the index option defaults for the collection.
|
BsonDocument |
GroupOperation.getInitial()
Gets the initial the aggregation result document.
|
BsonDocument |
GroupOperation.getKey()
Gets the document containing the field or fields to group.
|
BsonDocument |
FindOperation.getModifiers()
Gets the query modifiers to apply to this operation.
|
BsonDocument |
FindAndDeleteOperation.getProjection()
Gets a document describing the fields to return for all matching documents.
|
BsonDocument |
FindAndUpdateOperation.getProjection()
Gets a document describing the fields to return for all matching documents.
|
BsonDocument |
FindAndReplaceOperation.getProjection()
Gets a document describing the fields to return for all matching documents.
|
BsonDocument |
FindOperation.getProjection()
Gets a document describing the fields to return for all matching documents.
|
BsonDocument |
FindAndReplaceOperation.getReplacement()
Gets the document which will replace the document matching the query filter.
|
BsonDocument |
MapReduceToCollectionOperation.getScope()
Gets the global variables that are accessible in the map, reduce and finalize functions.
|
BsonDocument |
MapReduceWithInlineResultsOperation.getScope()
Gets the global variables that are accessible in the map, reduce and finalize functions.
|
BsonDocument |
FindAndDeleteOperation.getSort()
Gets the sort criteria to apply to the query.
|
BsonDocument |
MapReduceToCollectionOperation.getSort()
Gets the sort criteria to apply to the query.
|
BsonDocument |
FindAndUpdateOperation.getSort()
Gets the sort criteria to apply to the query.
|
BsonDocument |
FindAndReplaceOperation.getSort()
Gets the sort criteria to apply to the query.
|
BsonDocument |
FindOperation.getSort()
Gets the sort criteria to apply to the query.
|
BsonDocument |
MapReduceWithInlineResultsOperation.getSort()
Gets the sort criteria to apply to the query.
|
BsonDocument |
CreateCollectionOperation.getStorageEngineOptions()
Gets the storage engine options document for this collection.
|
BsonDocument |
FindAndUpdateOperation.getUpdate()
Gets the document containing update operators
|
BsonDocument |
CreateCollectionOperation.getValidator()
Gets the validation rules for inserting or updating documents
|
Modifier and Type | Method and Description |
---|---|
ReadOperation<BsonDocument> |
CountOperation.asExplainableOperation(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
ReadOperation<BsonDocument> |
AggregateOperation.asExplainableOperation(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
ReadOperation<BsonDocument> |
MapReduceToCollectionOperation.asExplainableOperation(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
ReadOperation<BsonDocument> |
FindOperation.asExplainableOperation(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
ReadOperation<BsonDocument> |
MapReduceWithInlineResultsOperation.asExplainableOperation(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
AsyncReadOperation<BsonDocument> |
CountOperation.asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
AsyncReadOperation<BsonDocument> |
AggregateOperation.asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
AsyncReadOperation<BsonDocument> |
MapReduceToCollectionOperation.asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
AsyncReadOperation<BsonDocument> |
FindOperation.asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
AsyncReadOperation<BsonDocument> |
MapReduceWithInlineResultsOperation.asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
List<BsonDocument> |
AggregateToCollectionOperation.getPipeline()
Gets the aggregation pipeline.
|
List<BsonDocument> |
AggregateOperation.getPipeline()
Gets the aggregation pipeline.
|
Modifier and Type | Method and Description |
---|---|
CountOperation |
CountOperation.filter(BsonDocument filter)
Sets the filter to apply to the query.
|
GroupOperation<T> |
GroupOperation.filter(BsonDocument filter)
Sets the optional query filter to determine which documents in the collection to process.
|
DistinctOperation<T> |
DistinctOperation.filter(BsonDocument filter)
Sets the query filter to apply to the query.
|
FindAndDeleteOperation<T> |
FindAndDeleteOperation.filter(BsonDocument filter)
Sets the filter to apply to the query.
|
MapReduceToCollectionOperation |
MapReduceToCollectionOperation.filter(BsonDocument filter)
Sets the filter to apply to the query.
|
ListCollectionsOperation<T> |
ListCollectionsOperation.filter(BsonDocument filter)
Sets the query filter to apply to the query.
|
FindAndUpdateOperation<T> |
FindAndUpdateOperation.filter(BsonDocument filter)
Sets the filter to apply to the query.
|
FindAndReplaceOperation<T> |
FindAndReplaceOperation.filter(BsonDocument filter)
Sets the query filter to apply to the query.
|
FindOperation<T> |
FindOperation.filter(BsonDocument filter)
Sets the query filter to apply to the query.
|
MapReduceWithInlineResultsOperation<T> |
MapReduceWithInlineResultsOperation.filter(BsonDocument filter)
Sets the filter to apply to the query.
|
CreateCollectionOperation |
CreateCollectionOperation.indexOptionDefaults(BsonDocument indexOptionDefaults)
Sets the index option defaults document for the collection.
|
GroupOperation<T> |
GroupOperation.key(BsonDocument key)
Sets the document containing the field or fields to group.
|
FindOperation<T> |
FindOperation.modifiers(BsonDocument modifiers)
Sets the query modifiers to apply to this operation.
|
FindAndDeleteOperation<T> |
FindAndDeleteOperation.projection(BsonDocument projection)
Sets a document describing the fields to return for all matching documents.
|
FindAndUpdateOperation<T> |
FindAndUpdateOperation.projection(BsonDocument projection)
Sets a document describing the fields to return for all matching documents.
|
FindAndReplaceOperation<T> |
FindAndReplaceOperation.projection(BsonDocument projection)
Sets a document describing the fields to return for all matching documents.
|
FindOperation<T> |
FindOperation.projection(BsonDocument projection)
Sets a document describing the fields to return for all matching documents.
|
MapReduceToCollectionOperation |
MapReduceToCollectionOperation.scope(BsonDocument scope)
Sets the global variables that are accessible in the map, reduce and finalize functions.
|
MapReduceWithInlineResultsOperation<T> |
MapReduceWithInlineResultsOperation.scope(BsonDocument scope)
Sets the global variables that are accessible in the map, reduce and finalize functions.
|
FindAndDeleteOperation<T> |
FindAndDeleteOperation.sort(BsonDocument sort)
Sets the sort criteria to apply to the query.
|
MapReduceToCollectionOperation |
MapReduceToCollectionOperation.sort(BsonDocument sort)
Sets the sort criteria to apply to the query.
|
FindAndUpdateOperation<T> |
FindAndUpdateOperation.sort(BsonDocument sort)
Sets the sort criteria to apply to the query.
|
FindAndReplaceOperation<T> |
FindAndReplaceOperation.sort(BsonDocument sort)
Sets the sort criteria to apply to the query.
|
FindOperation<T> |
FindOperation.sort(BsonDocument sort)
Sets the sort criteria to apply to the query.
|
MapReduceWithInlineResultsOperation<T> |
MapReduceWithInlineResultsOperation.sort(BsonDocument sort)
Sets the sort criteria to apply to the query.
|
CreateCollectionOperation |
CreateCollectionOperation.storageEngineOptions(BsonDocument storageEngineOptions)
Sets the storage engine options document for this collection.
|
CreateCollectionOperation |
CreateCollectionOperation.validator(BsonDocument validator)
Sets the validation rules for inserting or updating documents
|
Constructor and Description |
---|
CommandReadOperation(String databaseName,
BsonDocument command,
Decoder<T> decoder)
Construct a new instance.
|
CommandWriteOperation(String databaseName,
BsonDocument command,
Decoder<T> decoder)
Construct a new instance.
|
DropIndexOperation(MongoNamespace namespace,
BsonDocument keys)
Construct a new instance.
|
FindAndReplaceOperation(MongoNamespace namespace,
Decoder<T> decoder,
BsonDocument replacement)
|
FindAndReplaceOperation(MongoNamespace namespace,
WriteConcern writeConcern,
Decoder<T> decoder,
BsonDocument replacement)
Construct a new instance.
|
FindAndUpdateOperation(MongoNamespace namespace,
Decoder<T> decoder,
BsonDocument update)
|
FindAndUpdateOperation(MongoNamespace namespace,
WriteConcern writeConcern,
Decoder<T> decoder,
BsonDocument update)
Construct a new instance.
|
GroupOperation(MongoNamespace namespace,
BsonJavaScript reduceFunction,
BsonDocument initial,
Decoder<T> decoder)
Create an operation that will perform a Group on a given collection.
|
Constructor and Description |
---|
AggregateOperation(MongoNamespace namespace,
List<BsonDocument> pipeline,
Decoder<T> decoder)
Construct a new instance.
|
AggregateToCollectionOperation(MongoNamespace namespace,
List<BsonDocument> pipeline)
Construct a new instance.
|
Modifier and Type | Class and Description |
---|---|
class |
BsonDocumentWrapper<T>
A
BsonDocument that begins its life as a document of any type and an Encoder for that document, which lets an instance of
any class with an Encoder be treated as a BsonDocument. |
class |
RawBsonDocument
An immutable BSON document that is represented using only the raw bytes.
|
Modifier and Type | Method and Description |
---|---|
BsonDocument |
BsonDocument.append(String key,
BsonValue value)
Put the given key and value into this document, and return the document.
|
BsonDocument |
RawBsonDocument.append(String key,
BsonValue value) |
static BsonDocument |
BsonDocumentWrapper.asBsonDocument(Object document,
CodecRegistry codecRegistry)
A helper to convert an document of type Object to a BsonDocument
|
BsonDocument |
BsonValue.asDocument()
Gets this value as a BsonDocument if it is one, otherwise throws exception
|
BsonDocument |
BsonDocument.clone() |
BsonDocument |
RawBsonDocument.clone() |
BsonDocument |
BsonDocumentWrapper.clone() |
BsonDocument |
BsonDocumentWriter.getDocument()
Gets the document that the writer is writing to.
|
BsonDocument |
BsonDocument.getDocument(Object key)
Gets the value of the key if it is a BsonDocument, or throws if not.
|
BsonDocument |
BsonDocument.getDocument(Object key,
BsonDocument defaultValue)
If the document does not contain the given key, return the given default value.
|
BsonDocument |
BsonJavaScriptWithScope.getScope()
Get the scope.
|
static BsonDocument |
BsonDocument.parse(String json)
Parses a string in MongoDB Extended JSON format to a
BsonDocument |
<C> BsonDocument |
BsonDocument.toBsonDocument(Class<C> documentClass,
CodecRegistry codecRegistry) |
<C> BsonDocument |
Document.toBsonDocument(Class<C> documentClass,
CodecRegistry codecRegistry) |
Modifier and Type | Method and Description |
---|---|
BsonDocument |
BsonDocument.getDocument(Object key,
BsonDocument defaultValue)
If the document does not contain the given key, return the given default value.
|
Constructor and Description |
---|
BsonDocumentReader.Context(BsonDocumentReader.Context parentContext,
BsonContextType contextType,
BsonDocument document) |
BsonDocumentReader(BsonDocument document)
Construct a new instance.
|
BsonDocumentWriter(BsonDocument document)
Construct a new instance.
|
BsonJavaScriptWithScope(String code,
BsonDocument scope)
Construct a new instance with the given code and scope.
|
Modifier and Type | Method and Description |
---|---|
BsonDocument |
BsonDocumentCodec.decode(BsonReader reader,
DecoderContext decoderContext) |
BsonDocument |
BsonDocumentCodec.generateIdIfAbsentFromDocument(BsonDocument document) |
Modifier and Type | Method and Description |
---|---|
Class<BsonDocument> |
BsonDocumentCodec.getEncoderClass() |
Modifier and Type | Method and Description |
---|---|
boolean |
BsonDocumentCodec.documentHasId(BsonDocument document) |
void |
BsonDocumentCodec.encode(BsonWriter writer,
BsonDocument value,
EncoderContext encoderContext) |
BsonDocument |
BsonDocumentCodec.generateIdIfAbsentFromDocument(BsonDocument document) |
BsonValue |
BsonDocumentCodec.getDocumentId(BsonDocument document) |
Constructor and Description |
---|
BsonDocumentWrapperCodec(Codec<BsonDocument> bsonDocumentCodec)
Construct a new instance,
|
BsonJavaScriptWithScopeCodec(Codec<BsonDocument> documentCodec)
Construct a new instance with the given codec to use for the nested document
|
Modifier and Type | Method and Description |
---|---|
<TDocument> |
Bson.toBsonDocument(Class<TDocument> documentClass,
CodecRegistry codecRegistry)
Render the filter into a BsonDocument.
|
Copyright © 2016. All Rights Reserved.