Package | Description |
---|---|
com.mongodb.assertions |
Contains design by contract assertions
|
com.mongodb.async |
This package contains async interfaces
|
com.mongodb.async.client |
This packages contains classes for the new async client
|
com.mongodb.binding |
This package contains classes that manage binding to MongoDB servers for various operations.
|
com.mongodb.connection |
Contains classes that manage connecting to MongoDB servers.
|
com.mongodb.internal.async | |
com.mongodb.operation |
The core of the MongoDB driver works via operations, using the command pattern.
|
Modifier and Type | Method and Description |
---|---|
static void |
Assertions.isTrue(String name,
boolean condition,
SingleResultCallback<?> callback)
Throw IllegalStateException if the condition if false.
|
static <T> T |
Assertions.notNull(String name,
T value,
SingleResultCallback<?> callback)
Throw IllegalArgumentException if the value is null.
|
Modifier and Type | Method and Description |
---|---|
void |
AsyncBatchCursor.next(SingleResultCallback<List<T>> callback)
Returns the next batch of results.
|
Modifier and Type | Method and Description |
---|---|
void |
MongoIterable.batchCursor(SingleResultCallback<AsyncBatchCursor<TResult>> callback)
Provide the underlying
AsyncBatchCursor allowing fine grained control of the cursor. |
void |
MongoCollection.bulkWrite(List<? extends WriteModel<? extends TDocument>> requests,
BulkWriteOptions options,
SingleResultCallback<BulkWriteResult> callback)
Executes a mix of inserts, updates, replaces, and deletes.
|
void |
MongoCollection.bulkWrite(List<? extends WriteModel<? extends TDocument>> requests,
SingleResultCallback<BulkWriteResult> callback)
Executes a mix of inserts, updates, replaces, and deletes.
|
void |
MongoCollection.count(Bson filter,
CountOptions options,
SingleResultCallback<Long> callback)
Counts the number of documents in the collection according to the given options.
|
void |
MongoCollection.count(Bson filter,
SingleResultCallback<Long> callback)
Counts the number of documents in the collection according to the given options.
|
void |
MongoCollection.count(SingleResultCallback<Long> callback)
Counts the number of documents in the collection.
|
void |
MongoDatabase.createCollection(String collectionName,
CreateCollectionOptions options,
SingleResultCallback<Void> callback)
Create a new collection with the selected options
|
void |
MongoDatabase.createCollection(String collectionName,
SingleResultCallback<Void> callback)
Create a new collection with the given name.
|
void |
MongoCollection.createIndex(Bson key,
IndexOptions options,
SingleResultCallback<String> callback)
Creates an index.
|
void |
MongoCollection.createIndex(Bson key,
SingleResultCallback<String> callback)
Creates an index.
|
void |
MongoCollection.createIndexes(List<IndexModel> indexes,
SingleResultCallback<List<String>> callback)
Create multiple indexes.
|
void |
MongoCollection.deleteMany(Bson filter,
SingleResultCallback<DeleteResult> callback)
Removes all documents from the collection that match the given query filter.
|
void |
MongoCollection.deleteOne(Bson filter,
SingleResultCallback<DeleteResult> callback)
Removes at most one document from the collection that matches the given filter.
|
void |
MongoCollection.drop(SingleResultCallback<Void> callback)
Drops this collection from the Database.
|
void |
MongoDatabase.drop(SingleResultCallback<Void> callback)
Drops this database.
|
void |
MongoCollection.dropIndex(Bson keys,
SingleResultCallback<Void> callback)
Drops the index given the keys used to create it.
|
void |
MongoCollection.dropIndex(String indexName,
SingleResultCallback<Void> callback)
Drops the index given its name.
|
void |
MongoCollection.dropIndexes(SingleResultCallback<Void> callback)
Drop all the indexes on this collection, except for the default on _id.
|
void |
MongoCollection.findOneAndDelete(Bson filter,
FindOneAndDeleteOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and remove it.
|
void |
MongoCollection.findOneAndDelete(Bson filter,
SingleResultCallback<TDocument> callback)
Atomically find a document and remove it.
|
void |
MongoCollection.findOneAndReplace(Bson filter,
TDocument replacement,
FindOneAndReplaceOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and replace it.
|
void |
MongoCollection.findOneAndReplace(Bson filter,
TDocument replacement,
SingleResultCallback<TDocument> callback)
Atomically find a document and replace it.
|
void |
MongoCollection.findOneAndUpdate(Bson filter,
Bson update,
FindOneAndUpdateOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and update it.
|
void |
MongoCollection.findOneAndUpdate(Bson filter,
Bson update,
SingleResultCallback<TDocument> callback)
Atomically find a document and update it.
|
void |
MongoIterable.first(SingleResultCallback<TResult> callback)
Helper to return the first item in the iterator or null.
|
void |
MongoIterable.forEach(Block<? super TResult> block,
SingleResultCallback<Void> callback)
Iterates over all documents in the view, applying the given block to each, and completing the returned future after all documents
have been iterated, or an exception has occurred.
|
void |
MongoCollection.insertMany(List<? extends TDocument> documents,
InsertManyOptions options,
SingleResultCallback<Void> callback)
Inserts one or more documents.
|
void |
MongoCollection.insertMany(List<? extends TDocument> documents,
SingleResultCallback<Void> callback)
Inserts one or more documents.
|
void |
MongoCollection.insertOne(TDocument document,
InsertOneOptions options,
SingleResultCallback<Void> callback)
Inserts the provided document.
|
void |
MongoCollection.insertOne(TDocument document,
SingleResultCallback<Void> callback)
Inserts the provided document.
|
<A extends Collection<? super TResult>> |
MongoIterable.into(A target,
SingleResultCallback<A> callback)
Iterates over all the documents, adding each to the given target.
|
void |
MongoCollection.renameCollection(MongoNamespace newCollectionNamespace,
RenameCollectionOptions options,
SingleResultCallback<Void> callback)
Rename the collection with oldCollectionName to the newCollectionName.
|
void |
MongoCollection.renameCollection(MongoNamespace newCollectionNamespace,
SingleResultCallback<Void> callback)
Rename the collection with oldCollectionName to the newCollectionName.
|
void |
MongoCollection.replaceOne(Bson filter,
TDocument replacement,
SingleResultCallback<UpdateResult> callback)
Replace a document in the collection according to the specified arguments.
|
void |
MongoCollection.replaceOne(Bson filter,
TDocument replacement,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Replace a document in the collection according to the specified arguments.
|
<TResult> void |
MongoDatabase.runCommand(Bson command,
Class<TResult> resultClass,
SingleResultCallback<TResult> callback)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
<TResult> void |
MongoDatabase.runCommand(Bson command,
ReadPreference readPreference,
Class<TResult> resultClass,
SingleResultCallback<TResult> callback)
Executes the given command in the context of the current database with the given read preference.
|
void |
MongoDatabase.runCommand(Bson command,
ReadPreference readPreference,
SingleResultCallback<Document> callback)
Executes the given command in the context of the current database with the given read preference.
|
void |
MongoDatabase.runCommand(Bson command,
SingleResultCallback<Document> callback)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
void |
AggregateIterable.toCollection(SingleResultCallback<Void> callback)
Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage.
|
void |
MapReduceIterable.toCollection(SingleResultCallback<Void> callback)
Aggregates documents to a collection according to the specified map-reduce function with the given options, which must specify a
non-inline result.
|
void |
MongoCollection.updateMany(Bson filter,
Bson update,
SingleResultCallback<UpdateResult> callback)
Update all documents in the collection according to the specified arguments.
|
void |
MongoCollection.updateMany(Bson filter,
Bson update,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Update all documents in the collection according to the specified arguments.
|
void |
MongoCollection.updateOne(Bson filter,
Bson update,
SingleResultCallback<UpdateResult> callback)
Update a single document in the collection according to the specified arguments.
|
void |
MongoCollection.updateOne(Bson filter,
Bson update,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Update a single document in the collection according to the specified arguments.
|
Modifier and Type | Method and Description |
---|---|
static <TResult> Observable<TResult> |
Observables.observe(Block<SingleResultCallback<TResult>> operation)
Allows the conversion of
SingleResultCallback based operations into an Observable |
static <TResult> Observable<TResult> |
Observables.observeAndFlatten(Block<SingleResultCallback<List<TResult>>> operation)
Allows the conversion of
SingleResultCallback based operations and flattens the results in an Observable . |
Modifier and Type | Method and Description |
---|---|
void |
AsyncConnectionSource.getConnection(SingleResultCallback<AsyncConnection> callback)
Gets a connection from this source.
|
void |
AsyncReadBinding.getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Returns a connection source to a server that satisfies the specified read preference.
|
void |
AsyncSingleConnectionReadBinding.getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback) |
void |
AsyncClusterBinding.getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback) |
void |
AsyncWriteBinding.getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Supply a connection source to a server that can be written to
|
void |
AsyncClusterBinding.getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback) |
Modifier and Type | Method and Description |
---|---|
<T> void |
AsyncConnection.commandAsync(String database,
BsonDocument command,
boolean slaveOk,
FieldNameValidator fieldNameValidator,
Decoder<T> commandResultDecoder,
SingleResultCallback<T> callback)
Execute the command asynchronously.
|
void |
AsyncConnection.deleteAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes,
SingleResultCallback<WriteConcernResult> callback)
Delete the documents using the delete wire protocol and apply the write concern asynchronously.
|
void |
AsyncConnection.deleteCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes,
SingleResultCallback<BulkWriteResult> callback)
Delete the documents using the delete command asynchronously.
|
void |
Server.getConnectionAsync(SingleResultCallback<AsyncConnection> callback)
Gets a connection to this server asynchronously.
|
<T> void |
AsyncConnection.getMoreAsync(MongoNamespace namespace,
long cursorId,
int numberToReturn,
Decoder<T> resultDecoder,
SingleResultCallback<QueryResult<T>> callback)
Get more result documents from a cursor asynchronously.
|
void |
AsyncConnection.insertAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts,
SingleResultCallback<WriteConcernResult> callback)
Insert the documents using the insert wire protocol and apply the write concern asynchronously.
|
void |
AsyncConnection.insertCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
Boolean bypassDocumentValidation,
List<InsertRequest> inserts,
SingleResultCallback<BulkWriteResult> callback)
Insert the documents using the insert command asynchronously.
|
void |
AsyncConnection.insertCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts,
SingleResultCallback<BulkWriteResult> callback)
|
void |
AsyncConnection.killCursorAsync(List<Long> cursors,
SingleResultCallback<Void> callback)
Deprecated.
|
void |
AsyncConnection.killCursorAsync(MongoNamespace namespace,
List<Long> cursors,
SingleResultCallback<Void> callback)
Asynchronously Kills the given list of cursors.
|
<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.
|
void |
Cluster.selectServerAsync(ServerSelector serverSelector,
SingleResultCallback<Server> callback)
Asynchronously gets a MongoDB server that matches the criteria defined by the serverSelector.
|
void |
AsyncConnection.updateAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates,
SingleResultCallback<WriteConcernResult> callback)
Update the documents using the update wire protocol and apply the write concern asynchronously.
|
void |
AsyncConnection.updateCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
Boolean bypassDocumentValidation,
List<UpdateRequest> updates,
SingleResultCallback<BulkWriteResult> callback)
Update the documents using the update command asynchronously.
|
void |
AsyncConnection.updateCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates,
SingleResultCallback<BulkWriteResult> callback)
|
Modifier and Type | Class and Description |
---|---|
class |
ErrorHandlingResultCallback<T>
This class is not part of the public API and may be removed or changed at any time.
|
Modifier and Type | Method and Description |
---|---|
static <T> SingleResultCallback<T> |
ErrorHandlingResultCallback.errorHandlingCallback(SingleResultCallback<T> callback) |
static <T> SingleResultCallback<T> |
ErrorHandlingResultCallback.errorHandlingCallback(SingleResultCallback<T> callback,
Logger logger) |
Modifier and Type | Method and Description |
---|---|
static <T> SingleResultCallback<T> |
ErrorHandlingResultCallback.errorHandlingCallback(SingleResultCallback<T> callback) |
static <T> SingleResultCallback<T> |
ErrorHandlingResultCallback.errorHandlingCallback(SingleResultCallback<T> callback,
Logger logger) |
Modifier and Type | Method and Description |
---|---|
<T> void |
AsyncOperationExecutor.execute(AsyncReadOperation<T> operation,
ReadPreference readPreference,
SingleResultCallback<T> callback)
Execute the read operation with the given read preference.
|
<T> void |
AsyncOperationExecutor.execute(AsyncWriteOperation<T> operation,
SingleResultCallback<T> callback)
Execute the write operation.
|
void |
GroupOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback) |
void |
DistinctOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback) |
void |
ListIndexesOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback) |
void |
AggregateOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback) |
void |
ListCollectionsOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback) |
void |
ListDatabasesOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback) |
void |
FindOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback) |
void |
UserExistsOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<Boolean> callback) |
void |
ParallelCollectionScanOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<List<AsyncBatchCursor<T>>> callback) |
void |
CountOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<Long> callback) |
void |
MapReduceWithInlineResultsOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<MapReduceAsyncBatchCursor<T>> callback) |
void |
AsyncReadOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<T> callback)
General execute which can return anything of type T
|
void |
CommandReadOperation.executeAsync(AsyncReadBinding binding,
SingleResultCallback<T> callback) |
void |
MixedBulkWriteOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<BulkWriteResult> callback) |
void |
MapReduceToCollectionOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<MapReduceStatistics> callback) |
void |
AsyncWriteOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<T> callback)
General execute which can return anything of type T
|
void |
FindAndDeleteOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<T> callback) |
void |
FindAndUpdateOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<T> callback) |
void |
FindAndReplaceOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<T> callback) |
void |
CommandWriteOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<T> callback) |
void |
CreateUserOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
DropDatabaseOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
DropUserOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
AggregateToCollectionOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
CreateCollectionOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
UpdateUserOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
DropCollectionOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
CreateIndexesOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
RenameCollectionOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
DropIndexOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
void |
BaseWriteOperation.executeAsync(AsyncWriteBinding binding,
SingleResultCallback<WriteConcernResult> callback) |
protected abstract void |
BaseWriteOperation.executeCommandProtocolAsync(AsyncConnection connection,
SingleResultCallback<BulkWriteResult> callback)
Asynchronously executes the write command protocol.
|
protected void |
UpdateOperation.executeCommandProtocolAsync(AsyncConnection connection,
SingleResultCallback<BulkWriteResult> callback) |
protected void |
DeleteOperation.executeCommandProtocolAsync(AsyncConnection connection,
SingleResultCallback<BulkWriteResult> callback) |
protected void |
InsertOperation.executeCommandProtocolAsync(AsyncConnection connection,
SingleResultCallback<BulkWriteResult> callback) |
protected abstract void |
BaseWriteOperation.executeProtocolAsync(AsyncConnection connection,
SingleResultCallback<WriteConcernResult> callback)
Asynchronously executes the write protocol
|
protected void |
UpdateOperation.executeProtocolAsync(AsyncConnection connection,
SingleResultCallback<WriteConcernResult> callback) |
protected void |
DeleteOperation.executeProtocolAsync(AsyncConnection connection,
SingleResultCallback<WriteConcernResult> callback) |
protected void |
InsertOperation.executeProtocolAsync(AsyncConnection connection,
SingleResultCallback<WriteConcernResult> callback) |
Copyright © 2016. All Rights Reserved.