public interface AsyncMongoCollection
The synchronous methods for interacting with a collection are declared as
part of the MongoCollection
interface (which extends this interface.
MongoCollection
Modifier and Type | Field and Description |
---|---|
static Document |
ALL
An (empty) query document to find all documents.
|
static Document |
NONE
An (empty) update document to perform no actual modifications.
|
Modifier and Type | Method and Description |
---|---|
ListenableFuture<MongoIterator<Document>> |
aggregateAsync(Aggregate.Builder command)
Invokes a aggregate command on the server.
|
ListenableFuture<MongoIterator<Document>> |
aggregateAsync(Aggregate command)
Invokes a aggregate command on the server.
|
void |
aggregateAsync(Callback<MongoIterator<Document>> results,
Aggregate.Builder command)
Invokes a aggregate command on the server.
|
void |
aggregateAsync(Callback<MongoIterator<Document>> results,
Aggregate command)
Invokes a aggregate command on the server.
|
void |
aggregateAsync(LambdaCallback<MongoIterator<Document>> results,
Aggregate.Builder command)
Invokes a aggregate command on the server.
|
void |
aggregateAsync(LambdaCallback<MongoIterator<Document>> results,
Aggregate command)
Invokes a aggregate command on the server.
|
ListenableFuture<Long> |
countAsync()
Counts the set of documents in the collection.
|
void |
countAsync(Callback<Long> results)
Counts the set of documents in the collection.
|
void |
countAsync(Callback<Long> results,
Count.Builder count)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(Callback<Long> results,
Count count)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(Callback<Long> results,
DocumentAssignable query)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(Callback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(Callback<Long> results,
ReadPreference readPreference)
Counts the set of documents in the collection.
|
ListenableFuture<Long> |
countAsync(Count.Builder count)
Counts the set of documents matching the query document in the
collection.
|
ListenableFuture<Long> |
countAsync(Count count)
Counts the set of documents matching the query document in the
collection.
|
ListenableFuture<Long> |
countAsync(DocumentAssignable query)
Counts the set of documents matching the query document in the
collection.
|
ListenableFuture<Long> |
countAsync(DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(LambdaCallback<Long> results)
Counts the set of documents in the collection.
|
void |
countAsync(LambdaCallback<Long> results,
Count.Builder count)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(LambdaCallback<Long> results,
Count count)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(LambdaCallback<Long> results,
DocumentAssignable query)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(LambdaCallback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
countAsync(LambdaCallback<Long> results,
ReadPreference readPreference)
Counts the set of documents in the collection.
|
ListenableFuture<Long> |
countAsync(ReadPreference readPreference)
Counts the set of documents in the collection.
|
void |
deleteAsync(Callback<Long> results,
DocumentAssignable query)
Deletes a set of documents matching a query from the collection.
|
void |
deleteAsync(Callback<Long> results,
DocumentAssignable query,
boolean singleDelete)
Deletes a set of documents matching a query from the collection.
|
void |
deleteAsync(Callback<Long> results,
DocumentAssignable query,
boolean singleDelete,
Durability durability)
Deletes a set of documents matching a query from the collection.
|
void |
deleteAsync(Callback<Long> results,
DocumentAssignable query,
Durability durability)
Deletes a set of documents matching a query from the collection.
|
ListenableFuture<Long> |
deleteAsync(DocumentAssignable query)
Deletes a set of documents matching a query from the collection.
|
ListenableFuture<Long> |
deleteAsync(DocumentAssignable query,
boolean singleDelete)
Deletes a set of documents matching a query from the collection.
|
ListenableFuture<Long> |
deleteAsync(DocumentAssignable query,
boolean singleDelete,
Durability durability)
Deletes a set of documents matching a query from the collection.
|
ListenableFuture<Long> |
deleteAsync(DocumentAssignable query,
Durability durability)
Deletes a set of documents matching a query from the collection.
|
void |
deleteAsync(LambdaCallback<Long> results,
DocumentAssignable query)
Deletes a set of documents matching a query from the collection.
|
void |
deleteAsync(LambdaCallback<Long> results,
DocumentAssignable query,
boolean singleDelete)
Deletes a set of documents matching a query from the collection.
|
void |
deleteAsync(LambdaCallback<Long> results,
DocumentAssignable query,
boolean singleDelete,
Durability durability)
Deletes a set of documents matching a query from the collection.
|
void |
deleteAsync(LambdaCallback<Long> results,
DocumentAssignable query,
Durability durability)
Deletes a set of documents matching a query from the collection.
|
void |
distinctAsync(Callback<MongoIterator<Element>> results,
Distinct.Builder command)
Invokes a distinct command on the server.
|
void |
distinctAsync(Callback<MongoIterator<Element>> results,
Distinct command)
Invokes a distinct command on the server.
|
ListenableFuture<MongoIterator<Element>> |
distinctAsync(Distinct.Builder command)
Invokes a distinct command on the server.
|
ListenableFuture<MongoIterator<Element>> |
distinctAsync(Distinct command)
Invokes a distinct command on the server.
|
void |
distinctAsync(LambdaCallback<MongoIterator<Element>> results,
Distinct.Builder command)
Invokes a distinct command on the server.
|
void |
distinctAsync(LambdaCallback<MongoIterator<Element>> results,
Distinct command)
Invokes a distinct command on the server.
|
ListenableFuture<Document> |
explainAsync(Aggregate.Builder aggregation)
Explains the way that the aggregation will be performed.
|
ListenableFuture<Document> |
explainAsync(Aggregate aggregation)
Explains the way that the aggregation will be performed.
|
void |
explainAsync(Callback<Document> results,
Aggregate.Builder aggregation)
Explains the way that the aggregation will be performed.
|
void |
explainAsync(Callback<Document> results,
Aggregate aggregation)
Explains the way that the aggregation will be performed.
|
void |
explainAsync(Callback<Document> results,
Find.Builder query)
Explains the way that the query will be performed.
|
void |
explainAsync(Callback<Document> results,
Find query)
Explains the way that the query will be performed.
|
ListenableFuture<Document> |
explainAsync(Find.Builder query)
Explains the way that the document will be performed.
|
ListenableFuture<Document> |
explainAsync(Find query)
Explains the way that the document will be performed.
|
void |
explainAsync(LambdaCallback<Document> results,
Aggregate.Builder aggregation)
Explains the way that the aggregation will be performed.
|
void |
explainAsync(LambdaCallback<Document> results,
Aggregate aggregation)
Explains the way that the aggregation will be performed.
|
void |
explainAsync(LambdaCallback<Document> results,
Find.Builder query)
Explains the way that the query will be performed.
|
void |
explainAsync(LambdaCallback<Document> results,
Find query)
Explains the way that the query will be performed.
|
void |
findAndModifyAsync(Callback<Document> results,
FindAndModify.Builder command)
Invokes a findAndModify command on the server.
|
void |
findAndModifyAsync(Callback<Document> results,
FindAndModify command)
Invokes a findAndModify command on the server.
|
ListenableFuture<Document> |
findAndModifyAsync(FindAndModify.Builder command)
Invokes a findAndModify command on the server.
|
ListenableFuture<Document> |
findAndModifyAsync(FindAndModify command)
Invokes a findAndModify command on the server.
|
void |
findAndModifyAsync(LambdaCallback<Document> results,
FindAndModify.Builder command)
Invokes a findAndModify command on the server.
|
void |
findAndModifyAsync(LambdaCallback<Document> results,
FindAndModify command)
Invokes a findAndModify command on the server.
|
void |
findAsync(Callback<MongoIterator<Document>> results,
DocumentAssignable query)
Finds the set of documents matching the query document in the collection.
|
void |
findAsync(Callback<MongoIterator<Document>> results,
Find.Builder query)
Finds the set of documents matching the query in the collection.
|
void |
findAsync(Callback<MongoIterator<Document>> results,
Find query)
Finds the set of documents matching the query in the collection.
|
ListenableFuture<MongoIterator<Document>> |
findAsync(DocumentAssignable query)
Finds the set of documents matching the query document in the collection.
|
ListenableFuture<MongoIterator<Document>> |
findAsync(Find.Builder query)
Finds the set of documents matching the query in the collection.
|
ListenableFuture<MongoIterator<Document>> |
findAsync(Find query)
Finds the set of documents matching the query in the collection.
|
void |
findAsync(LambdaCallback<MongoIterator<Document>> results,
DocumentAssignable query)
Finds the set of documents matching the query document in the collection.
|
void |
findAsync(LambdaCallback<MongoIterator<Document>> results,
Find.Builder query)
Finds the set of documents matching the query in the collection.
|
void |
findAsync(LambdaCallback<MongoIterator<Document>> results,
Find query)
Finds the set of documents matching the query in the collection.
|
void |
findOneAsync(Callback<Document> results,
DocumentAssignable query)
Finds a single matching document in the collection.
|
void |
findOneAsync(Callback<Document> results,
Find.Builder query)
Finds a single matching document in the collection.
|
void |
findOneAsync(Callback<Document> results,
Find query)
Finds a single matching document in the collection.
|
ListenableFuture<Document> |
findOneAsync(DocumentAssignable query)
Finds a single matching document in the collection.
|
ListenableFuture<Document> |
findOneAsync(Find.Builder query)
Finds a single matching document in the collection.
|
ListenableFuture<Document> |
findOneAsync(Find query)
Finds a single matching document in the collection.
|
void |
findOneAsync(LambdaCallback<Document> results,
DocumentAssignable query)
Finds a single matching document in the collection.
|
void |
findOneAsync(LambdaCallback<Document> results,
Find.Builder query)
Finds a single matching document in the collection.
|
void |
findOneAsync(LambdaCallback<Document> results,
Find query)
Finds a single matching document in the collection.
|
void |
groupByAsync(Callback<MongoIterator<Element>> results,
GroupBy.Builder command)
Invokes a group command on the server.
|
void |
groupByAsync(Callback<MongoIterator<Element>> results,
GroupBy command)
Invokes a group command on the server.
|
ListenableFuture<MongoIterator<Element>> |
groupByAsync(GroupBy.Builder command)
Invokes a group command on the server.
|
ListenableFuture<MongoIterator<Element>> |
groupByAsync(GroupBy command)
Invokes a group command on the server.
|
void |
groupByAsync(LambdaCallback<MongoIterator<Element>> results,
GroupBy.Builder command)
Invokes a group command on the server.
|
void |
groupByAsync(LambdaCallback<MongoIterator<Element>> results,
GroupBy command)
Invokes a group command on the server.
|
ListenableFuture<Integer> |
insertAsync(boolean continueOnError,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
ListenableFuture<Integer> |
insertAsync(boolean continueOnError,
Durability durability,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
insertAsync(Callback<Integer> results,
boolean continueOnError,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
insertAsync(Callback<Integer> results,
boolean continueOnError,
Durability durability,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
insertAsync(Callback<Integer> results,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
insertAsync(Callback<Integer> results,
Durability durability,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
ListenableFuture<Integer> |
insertAsync(DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
ListenableFuture<Integer> |
insertAsync(Durability durability,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
insertAsync(LambdaCallback<Integer> results,
boolean continueOnError,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
insertAsync(LambdaCallback<Integer> results,
boolean continueOnError,
Durability durability,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
insertAsync(LambdaCallback<Integer> results,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
insertAsync(LambdaCallback<Integer> results,
Durability durability,
DocumentAssignable... documents)
Inserts a set of documents into the collection.
|
void |
mapReduceAsync(Callback<MongoIterator<Document>> results,
MapReduce.Builder command)
Invokes a mapReduce command on the server.
|
void |
mapReduceAsync(Callback<MongoIterator<Document>> results,
MapReduce command)
Invokes a mapReduce command on the server.
|
void |
mapReduceAsync(LambdaCallback<MongoIterator<Document>> results,
MapReduce.Builder command)
Invokes a mapReduce command on the server.
|
void |
mapReduceAsync(LambdaCallback<MongoIterator<Document>> results,
MapReduce command)
Invokes a mapReduce command on the server.
|
ListenableFuture<MongoIterator<Document>> |
mapReduceAsync(MapReduce.Builder command)
Invokes a mapReduce command on the server.
|
ListenableFuture<MongoIterator<Document>> |
mapReduceAsync(MapReduce command)
Invokes a mapReduce command on the server.
|
void |
parallelScanAsync(Callback<Collection<MongoIterator<Document>>> results,
ParallelScan.Builder parallelScan)
Uses the
parallelCollectionScan command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. |
void |
parallelScanAsync(Callback<Collection<MongoIterator<Document>>> results,
ParallelScan parallelScan)
Uses the
parallelCollectionScan command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. |
void |
parallelScanAsync(LambdaCallback<Collection<MongoIterator<Document>>> results,
ParallelScan.Builder parallelScan)
Uses the
parallelCollectionScan command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. |
void |
parallelScanAsync(LambdaCallback<Collection<MongoIterator<Document>>> results,
ParallelScan parallelScan)
Uses the
parallelCollectionScan command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. |
ListenableFuture<Collection<MongoIterator<Document>>> |
parallelScanAsync(ParallelScan.Builder parallelScan)
Uses the
parallelCollectionScan command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. |
ListenableFuture<Collection<MongoIterator<Document>>> |
parallelScanAsync(ParallelScan parallelScan)
Uses the
parallelCollectionScan command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. |
void |
saveAsync(Callback<Integer> results,
DocumentAssignable document)
Saves the
document to the collection. |
void |
saveAsync(Callback<Integer> results,
DocumentAssignable document,
Durability durability)
Saves the
document to the collection. |
ListenableFuture<Integer> |
saveAsync(DocumentAssignable document)
Saves the
document to the collection. |
ListenableFuture<Integer> |
saveAsync(DocumentAssignable document,
Durability durability)
Saves the
document to the collection. |
void |
saveAsync(LambdaCallback<Integer> results,
DocumentAssignable document)
Saves the
document to the collection. |
void |
saveAsync(LambdaCallback<Integer> results,
DocumentAssignable document,
Durability durability)
Saves the
document to the collection. |
MongoCursorControl |
stream(LambdaCallback<Document> results,
Aggregate.Builder aggregation)
Performs an aggregation and streams them to the provided callback one at
a time.
|
MongoCursorControl |
stream(LambdaCallback<Document> results,
Aggregate aggregation)
Performs an aggregation and streams them to the provided callback one at
a time.
|
MongoCursorControl |
stream(LambdaCallback<Document> results,
Find.Builder query)
Finds the set of documents matching the query in the collection and
streams them to the provided callback one at a time.
|
MongoCursorControl |
stream(LambdaCallback<Document> results,
Find query)
Finds the set of documents matching the query in the collection and
streams them to the provided callback one at a time.
|
MongoCursorControl |
stream(StreamCallback<Document> results,
Aggregate.Builder aggregation)
Performs an aggregation and streams them to the provided callback one at
a time.
|
MongoCursorControl |
stream(StreamCallback<Document> results,
Aggregate aggregation)
Performs an aggregation and streams them to the provided callback one at
a time.
|
MongoCursorControl |
stream(StreamCallback<Document> results,
Find.Builder query)
Finds the set of documents matching the query in the collection and
streams them to the provided callback one at a time.
|
MongoCursorControl |
stream(StreamCallback<Document> results,
Find query)
Finds the set of documents matching the query in the collection and
streams them to the provided callback one at a time.
|
MongoCursorControl |
streamingFind(Callback<Document> results,
DocumentAssignable query)
Deprecated.
Use the
streamingFind(StreamCallback, DocumentAssignable)
method instead. This method will be removed after the 1.3.0
release. |
MongoCursorControl |
streamingFind(Callback<Document> results,
Find query)
Deprecated.
Use the
stream(StreamCallback, Find) method instead.
This method will be removed after the 1.3.0 release. |
MongoCursorControl |
streamingFind(LambdaCallback<Document> results,
DocumentAssignable query)
Finds the set of documents matching the query document in the collection
and streams them to the provided callback one at a time.
|
MongoCursorControl |
streamingFind(StreamCallback<Document> results,
DocumentAssignable query)
Finds the set of documents matching the query document in the collection
and streams them to the provided callback one at a time.
|
MongoCursorControl |
streamingFind(StreamCallback<Document> results,
Find.Builder query)
Deprecated.
Use the
stream(StreamCallback, Find.Builder) method
instead. This method will be removed after the 1.4.0 release. |
MongoCursorControl |
streamingFind(StreamCallback<Document> results,
Find query)
Deprecated.
Use the
stream(StreamCallback, Find) method instead.
This method will be removed after the 1.4.0 release. |
void |
textSearchAsync(Callback<MongoIterator<TextResult>> results,
Text.Builder command)
Deprecated.
Support for the
text command was deprecated in the
2.6 version of MongoDB. Use the
$text query operator
instead. This method will not be removed until two releases
after the MongoDB 2.6 release (e.g. 2.10 if the releases are
2.8 and 2.10). |
void |
textSearchAsync(Callback<MongoIterator<TextResult>> results,
Text command)
Deprecated.
Support for the
text command was deprecated in the
2.6 version of MongoDB. Use the
$text query operator
instead. This method will not be removed until two releases
after the MongoDB 2.6 release (e.g. 2.10 if the releases are
2.8 and 2.10). |
ListenableFuture<MongoIterator<TextResult>> |
textSearchAsync(Text.Builder command)
Deprecated.
Support for the
text command was deprecated in the
2.6 version of MongoDB. Use the
$text query operator
instead. This method will not be removed until two releases
after the MongoDB 2.6 release (e.g. 2.10 if the releases are
2.8 and 2.10). |
ListenableFuture<MongoIterator<TextResult>> |
textSearchAsync(Text command)
Deprecated.
Support for the
text command was deprecated in the
2.6 version of MongoDB. Use the
$text query operator
instead. This method will not be removed until two releases
after the MongoDB 2.6 release (e.g. 2.10 if the releases are
2.8 and 2.10). |
void |
updateAsync(Callback<Long> results,
DocumentAssignable query,
DocumentAssignable update)
Applies updates to a set of documents within the collection.
|
void |
updateAsync(Callback<Long> results,
DocumentAssignable query,
DocumentAssignable update,
boolean multiUpdate,
boolean upsert)
Applies updates to a set of documents within the collection.
|
void |
updateAsync(Callback<Long> results,
DocumentAssignable query,
DocumentAssignable update,
boolean multiUpdate,
boolean upsert,
Durability durability)
Applies updates to a set of documents within the collection.
|
void |
updateAsync(Callback<Long> results,
DocumentAssignable query,
DocumentAssignable update,
Durability durability)
Applies updates to a set of documents within the collection.
|
ListenableFuture<Long> |
updateAsync(DocumentAssignable query,
DocumentAssignable update)
Applies updates to a set of documents within the collection.
|
ListenableFuture<Long> |
updateAsync(DocumentAssignable query,
DocumentAssignable update,
boolean multiUpdate,
boolean upsert)
Applies updates to a set of documents within the collection.
|
ListenableFuture<Long> |
updateAsync(DocumentAssignable query,
DocumentAssignable update,
boolean multiUpdate,
boolean upsert,
Durability durability)
Applies updates to a set of documents within the collection.
|
ListenableFuture<Long> |
updateAsync(DocumentAssignable query,
DocumentAssignable update,
Durability durability)
Applies updates to a set of documents within the collection.
|
void |
updateAsync(LambdaCallback<Long> results,
DocumentAssignable query,
DocumentAssignable update)
Applies updates to a set of documents within the collection.
|
void |
updateAsync(LambdaCallback<Long> results,
DocumentAssignable query,
DocumentAssignable update,
boolean multiUpdate,
boolean upsert)
Applies updates to a set of documents within the collection.
|
void |
updateAsync(LambdaCallback<Long> results,
DocumentAssignable query,
DocumentAssignable update,
boolean multiUpdate,
boolean upsert,
Durability durability)
Applies updates to a set of documents within the collection.
|
void |
updateAsync(LambdaCallback<Long> results,
DocumentAssignable query,
DocumentAssignable update,
Durability durability)
Applies updates to a set of documents within the collection.
|
ListenableFuture<Long> |
writeAsync(BatchedWrite.Builder write)
Constructs the appropriate set of write commands to send to the server.
|
ListenableFuture<Long> |
writeAsync(BatchedWrite write)
Constructs the appropriate set of write commands to send to the server.
|
void |
writeAsync(Callback<Long> results,
BatchedWrite.Builder write)
Constructs the appropriate set of write commands to send to the server.
|
void |
writeAsync(Callback<Long> results,
BatchedWrite write)
Constructs the appropriate set of write commands to send to the server.
|
void |
writeAsync(LambdaCallback<Long> results,
BatchedWrite.Builder write)
Constructs the appropriate set of write commands to send to the server.
|
void |
writeAsync(LambdaCallback<Long> results,
BatchedWrite write)
Constructs the appropriate set of write commands to send to the server.
|
static final Document ALL
static final Document NONE
ListenableFuture<MongoIterator<Document>> aggregateAsync(Aggregate command) throws MongoDbException
command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.ListenableFuture<MongoIterator<Document>> aggregateAsync(Aggregate.Builder command) throws MongoDbException
command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.void aggregateAsync(Callback<MongoIterator<Document>> results, Aggregate command) throws MongoDbException
results
- Callback for the aggregation results returned.command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.void aggregateAsync(Callback<MongoIterator<Document>> results, Aggregate.Builder command) throws MongoDbException
results
- Callback for the aggregation results returned.command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.void aggregateAsync(LambdaCallback<MongoIterator<Document>> results, Aggregate command) throws MongoDbException
results
- Callback for the aggregation results returned.command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.void aggregateAsync(LambdaCallback<MongoIterator<Document>> results, Aggregate.Builder command) throws MongoDbException
results
- Callback for the aggregation results returned.command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.ListenableFuture<Long> countAsync() throws MongoDbException
This is equivalent to calling countAsync().get()
MongoDbException
- On an error finding the documents.void countAsync(Callback<Long> results) throws MongoDbException
This is equivalent to calling
countAsync(results,
BuilderFactory.start())
results
- The callback to notify of the results.MongoDbException
- On an error finding the documents.void countAsync(Callback<Long> results, Count count) throws MongoDbException
results
- The callback to notify of the results.count
- The count command.MongoDbException
- On an error counting the documents.void countAsync(Callback<Long> results, Count.Builder count) throws MongoDbException
results
- The callback to notify of the results.count
- The count command.MongoDbException
- On an error counting the documents.void countAsync(Callback<Long> results, DocumentAssignable query) throws MongoDbException
results
- The callback to notify of the results.query
- The query document.MongoDbException
- On an error finding the documents.void countAsync(Callback<Long> results, DocumentAssignable query, ReadPreference readPreference) throws MongoDbException
results
- The callback to notify of the results.query
- The query document.readPreference
- The preference for which servers to use to retrieve the
results.MongoDbException
- On an error finding the documents.void countAsync(Callback<Long> results, ReadPreference readPreference) throws MongoDbException
This is equivalent to calling
countAsync(results,
BuilderFactory.start(), readPreference)
results
- The callback to notify of the results.readPreference
- The preference for which servers to use to retrieve the
results.MongoDbException
- On an error finding the documents.ListenableFuture<Long> countAsync(Count count) throws MongoDbException
count
- The count command.MongoDbException
- On an error counting the documents.ListenableFuture<Long> countAsync(Count.Builder count) throws MongoDbException
count
- The count command.MongoDbException
- On an error counting the documents.ListenableFuture<Long> countAsync(DocumentAssignable query) throws MongoDbException
query
- The query document.MongoDbException
- On an error finding the documents.ListenableFuture<Long> countAsync(DocumentAssignable query, ReadPreference readPreference) throws MongoDbException
query
- The query document.readPreference
- The preference for which servers to use to retrieve the
results.MongoDbException
- On an error finding the documents.void countAsync(LambdaCallback<Long> results) throws MongoDbException
This is equivalent to calling
countAsync(results, BuilderFactory.start())
results
- The callback to notify of the results.MongoDbException
- On an error finding the documents.void countAsync(LambdaCallback<Long> results, Count count) throws MongoDbException
results
- The callback to notify of the results.count
- The count command.MongoDbException
- On an error counting the documents.void countAsync(LambdaCallback<Long> results, Count.Builder count) throws MongoDbException
results
- The callback to notify of the results.count
- The count command.MongoDbException
- On an error counting the documents.void countAsync(LambdaCallback<Long> results, DocumentAssignable query) throws MongoDbException
results
- The callback to notify of the results.query
- The query document.MongoDbException
- On an error finding the documents.void countAsync(LambdaCallback<Long> results, DocumentAssignable query, ReadPreference readPreference) throws MongoDbException
results
- The callback to notify of the results.query
- The query document.readPreference
- The preference for which servers to use to retrieve the
results.MongoDbException
- On an error finding the documents.void countAsync(LambdaCallback<Long> results, ReadPreference readPreference) throws MongoDbException
This is equivalent to calling
countAsync(results, BuilderFactory.start(), readPreference)
results
- The callback to notify of the results.readPreference
- The preference for which servers to use to retrieve the
results.MongoDbException
- On an error finding the documents.ListenableFuture<Long> countAsync(ReadPreference readPreference) throws MongoDbException
This is equivalent to calling countAsync().get()
readPreference
- The preference for which servers to use to retrieve the
results.MongoDbException
- On an error finding the documents.void deleteAsync(Callback<Long> results, DocumentAssignable query) throws MongoDbException
results
- Callback that will be notified of the results of the query. If
the durability of the operation is NONE then this will be -1.query
- Query to locate the documents to be deleted.MongoDbException
- On an error deleting the documents.void deleteAsync(Callback<Long> results, DocumentAssignable query, boolean singleDelete) throws MongoDbException
results
- Callback that will be notified of the results of the query. If
the durability of the operation is NONE then this will be -1.query
- Query to locate the documents to be deleted.singleDelete
- If true then only a single document will be deleted. If
running in a sharded environment then this field must be false
or the query must contain the shard key.MongoDbException
- On an error deleting the documents.void deleteAsync(Callback<Long> results, DocumentAssignable query, boolean singleDelete, Durability durability) throws MongoDbException
results
- Callback that will be notified of the results of the query. If
the durability of the operation is NONE then this will be -1.query
- Query to locate the documents to be deleted.singleDelete
- If true then only a single document will be deleted. If
running in a sharded environment then this field must be false
or the query must contain the shard key.durability
- The durability for the delete.MongoDbException
- On an error deleting the documents.void deleteAsync(Callback<Long> results, DocumentAssignable query, Durability durability) throws MongoDbException
results
- Callback that will be notified of the results of the query. If
the durability of the operation is NONE then this will be -1.query
- Query to locate the documents to be deleted.durability
- The durability for the delete.MongoDbException
- On an error deleting the documents.ListenableFuture<Long> deleteAsync(DocumentAssignable query) throws MongoDbException
query
- Query to locate the documents to be deleted.MongoDbException
- On an error deleting the documents.ListenableFuture<Long> deleteAsync(DocumentAssignable query, boolean singleDelete) throws MongoDbException
query
- Query to locate the documents to be deleted.singleDelete
- If true then only a single document will be deleted. If
running in a sharded environment then this field must be false
or the query must contain the shard key.MongoDbException
- On an error deleting the documents.ListenableFuture<Long> deleteAsync(DocumentAssignable query, boolean singleDelete, Durability durability) throws MongoDbException
query
- Query to locate the documents to be deleted.singleDelete
- If true then only a single document will be deleted. If
running in a sharded environment then this field must be false
or the query must contain the shard key.durability
- The durability for the delete.MongoDbException
- On an error deleting the documents.ListenableFuture<Long> deleteAsync(DocumentAssignable query, Durability durability) throws MongoDbException
query
- Query to locate the documents to be deleted.durability
- The durability for the delete.MongoDbException
- On an error deleting the documents.void deleteAsync(LambdaCallback<Long> results, DocumentAssignable query) throws MongoDbException
results
- Callback that will be notified of the results of the query. If
the durability of the operation is NONE then this will be -1.query
- Query to locate the documents to be deleted.MongoDbException
- On an error deleting the documents.void deleteAsync(LambdaCallback<Long> results, DocumentAssignable query, boolean singleDelete) throws MongoDbException
results
- Callback that will be notified of the results of the query. If
the durability of the operation is NONE then this will be -1.query
- Query to locate the documents to be deleted.singleDelete
- If true then only a single document will be deleted. If
running in a sharded environment then this field must be false
or the query must contain the shard key.MongoDbException
- On an error deleting the documents.void deleteAsync(LambdaCallback<Long> results, DocumentAssignable query, boolean singleDelete, Durability durability) throws MongoDbException
results
- Callback that will be notified of the results of the query. If
the durability of the operation is NONE then this will be -1.query
- Query to locate the documents to be deleted.singleDelete
- If true then only a single document will be deleted. If
running in a sharded environment then this field must be false
or the query must contain the shard key.durability
- The durability for the delete.MongoDbException
- On an error deleting the documents.void deleteAsync(LambdaCallback<Long> results, DocumentAssignable query, Durability durability) throws MongoDbException
results
- Callback that will be notified of the results of the query. If
the durability of the operation is NONE then this will be -1.query
- Query to locate the documents to be deleted.durability
- The durability for the delete.MongoDbException
- On an error deleting the documents.void distinctAsync(Callback<MongoIterator<Element>> results, Distinct command) throws MongoDbException
results
- Callback for the distinct results returned.command
- The details of the distinct request.MongoDbException
- On an error finding the documents.void distinctAsync(Callback<MongoIterator<Element>> results, Distinct.Builder command) throws MongoDbException
results
- Callback for the distinct results returned.command
- The details of the distinct request.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Element>> distinctAsync(Distinct command) throws MongoDbException
command
- The details of the distinct request.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Element>> distinctAsync(Distinct.Builder command) throws MongoDbException
command
- The details of the distinct request.MongoDbException
- On an error finding the documents.void distinctAsync(LambdaCallback<MongoIterator<Element>> results, Distinct command) throws MongoDbException
results
- Callback for the distinct results returned.command
- The details of the distinct request.MongoDbException
- On an error finding the documents.void distinctAsync(LambdaCallback<MongoIterator<Element>> results, Distinct.Builder command) throws MongoDbException
results
- Callback for the distinct results returned.command
- The details of the distinct request.MongoDbException
- On an error finding the documents.ListenableFuture<Document> explainAsync(Aggregate aggregation) throws MongoDbException
aggregation
- The aggregation details.MongoDbException
- On an error finding the documents.ListenableFuture<Document> explainAsync(Aggregate.Builder aggregation) throws MongoDbException
aggregation
- The aggregation details.MongoDbException
- On an error finding the documents.void explainAsync(Callback<Document> results, Aggregate aggregation) throws MongoDbException
aggregation
- The aggregation details.results
- Callback that will be notified of the results of the explain.MongoDbException
- On an error finding the documents.void explainAsync(Callback<Document> results, Aggregate.Builder aggregation) throws MongoDbException
aggregation
- The aggregation details.results
- Callback that will be notified of the results of the explain.MongoDbException
- On an error finding the documents.void explainAsync(Callback<Document> results, Find query) throws MongoDbException
query
- The query details.results
- Callback that will be notified of the results of the explain.MongoDbException
- On an error finding the documents.void explainAsync(Callback<Document> results, Find.Builder query) throws MongoDbException
query
- The query details.results
- Callback that will be notified of the results of the explain.MongoDbException
- On an error finding the documents.ListenableFuture<Document> explainAsync(Find query) throws MongoDbException
query
- The query details.MongoDbException
- On an error finding the documents.ListenableFuture<Document> explainAsync(Find.Builder query) throws MongoDbException
query
- The query details.MongoDbException
- On an error finding the documents.void explainAsync(LambdaCallback<Document> results, Aggregate aggregation) throws MongoDbException
aggregation
- The aggregation details.results
- Callback that will be notified of the results of the explain.MongoDbException
- On an error finding the documents.void explainAsync(LambdaCallback<Document> results, Aggregate.Builder aggregation) throws MongoDbException
aggregation
- The aggregation details.results
- Callback that will be notified of the results of the explain.MongoDbException
- On an error finding the documents.void explainAsync(LambdaCallback<Document> results, Find query) throws MongoDbException
query
- The query details.results
- Callback that will be notified of the results of the explain.MongoDbException
- On an error finding the documents.void explainAsync(LambdaCallback<Document> results, Find.Builder query) throws MongoDbException
query
- The query details.results
- Callback that will be notified of the results of the explain.MongoDbException
- On an error finding the documents.void findAndModifyAsync(Callback<Document> results, FindAndModify command) throws MongoDbException
results
- Callback for the the found document.command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.void findAndModifyAsync(Callback<Document> results, FindAndModify.Builder command) throws MongoDbException
results
- Callback for the the found document.command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.ListenableFuture<Document> findAndModifyAsync(FindAndModify command) throws MongoDbException
command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.ListenableFuture<Document> findAndModifyAsync(FindAndModify.Builder command) throws MongoDbException
command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.void findAndModifyAsync(LambdaCallback<Document> results, FindAndModify command) throws MongoDbException
results
- Callback for the the found document.command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.void findAndModifyAsync(LambdaCallback<Document> results, FindAndModify.Builder command) throws MongoDbException
results
- Callback for the the found document.command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.void findAsync(Callback<MongoIterator<Document>> results, DocumentAssignable query) throws MongoDbException
results
- Callback that will be notified of the results of the query.query
- The query document.MongoDbException
- On an error finding the documents.void findAsync(Callback<MongoIterator<Document>> results, Find query) throws MongoDbException
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the documents.void findAsync(Callback<MongoIterator<Document>> results, Find.Builder query) throws MongoDbException
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Document>> findAsync(DocumentAssignable query) throws MongoDbException
query
- The query document.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Document>> findAsync(Find query) throws MongoDbException
query
- The query details.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Document>> findAsync(Find.Builder query) throws MongoDbException
query
- The query details.MongoDbException
- On an error finding the documents.void findAsync(LambdaCallback<MongoIterator<Document>> results, DocumentAssignable query) throws MongoDbException
results
- Callback that will be notified of the results of the query.query
- The query document.MongoDbException
- On an error finding the documents.void findAsync(LambdaCallback<MongoIterator<Document>> results, Find query) throws MongoDbException
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the documents.void findAsync(LambdaCallback<MongoIterator<Document>> results, Find.Builder query) throws MongoDbException
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the documents.void findOneAsync(Callback<Document> results, DocumentAssignable query) throws MongoDbException
results
- Callback that will be notified of the results of the query.query
- The query document.MongoDbException
- On an error finding the document.void findOneAsync(Callback<Document> results, Find query) throws MongoDbException
Note that following options in the Find
class do not make sense
and are silently ignored by this method.
Batch Size
- Automatically set to 1.Limit
- Automatically set to 1.Tailable
- This method only returns 1
document.results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the document.void findOneAsync(Callback<Document> results, Find.Builder query) throws MongoDbException
Note that following options in the Find
class do not make sense
and are silently ignored by this method.
Batch Size
- Automatically set to 1.Limit
- Automatically set to 1.Tailable
- This method only returns 1
document.results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the document.ListenableFuture<Document> findOneAsync(DocumentAssignable query) throws MongoDbException
query
- The query document.MongoDbException
- On an error finding the document.ListenableFuture<Document> findOneAsync(Find query) throws MongoDbException
Note that following options in the Find
class do not make sense
and are silently ignored by this method.
Batch Size
- Automatically set to 1.Limit
- Automatically set to 1.Tailable
- This method only returns 1
document.query
- The query details.MongoDbException
- On an error finding the document.ListenableFuture<Document> findOneAsync(Find.Builder query) throws MongoDbException
Note that following options in the Find
class do not make sense
and are silently ignored by this method.
Batch Size
- Automatically set to 1.Limit
- Automatically set to 1.Tailable
- This method only returns 1
document.query
- The query details.MongoDbException
- On an error finding the document.void findOneAsync(LambdaCallback<Document> results, DocumentAssignable query) throws MongoDbException
results
- Callback that will be notified of the results of the query.query
- The query document.MongoDbException
- On an error finding the document.void findOneAsync(LambdaCallback<Document> results, Find query) throws MongoDbException
Note that following options in the Find
class do not make sense
and are silently ignored by this method.
Batch Size
- Automatically set to 1.Limit
- Automatically set to 1.Tailable
- This method only returns 1
document.results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the document.void findOneAsync(LambdaCallback<Document> results, Find.Builder query) throws MongoDbException
Note that following options in the Find
class do not make sense
and are silently ignored by this method.
Batch Size
- Automatically set to 1.Limit
- Automatically set to 1.Tailable
- This method only returns 1
document.results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the document.void groupByAsync(Callback<MongoIterator<Element>> results, GroupBy command) throws MongoDbException
results
- Callback for the group results returned.command
- The details of the group request.MongoDbException
- On an error finding the documents.void groupByAsync(Callback<MongoIterator<Element>> results, GroupBy.Builder command) throws MongoDbException
results
- Callback for the group results returned.command
- The details of the group request.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Element>> groupByAsync(GroupBy command) throws MongoDbException
command
- The details of the group request.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Element>> groupByAsync(GroupBy.Builder command) throws MongoDbException
command
- The details of the group request.MongoDbException
- On an error finding the documents.void groupByAsync(LambdaCallback<MongoIterator<Element>> results, GroupBy command) throws MongoDbException
results
- Callback for the group results returned.command
- The details of the group request.MongoDbException
- On an error finding the documents.void groupByAsync(LambdaCallback<MongoIterator<Element>> results, GroupBy.Builder command) throws MongoDbException
results
- Callback for the group results returned.command
- The details of the group request.MongoDbException
- On an error finding the documents.ListenableFuture<Integer> insertAsync(boolean continueOnError, DocumentAssignable... documents) throws MongoDbException
continueOnError
- If the insert should continue if one of the documents causes
an error.documents
- The documents to add to the collection.-1
.MongoDbException
- On an error inserting the documents.ListenableFuture<Integer> insertAsync(boolean continueOnError, Durability durability, DocumentAssignable... documents) throws MongoDbException
continueOnError
- If the insert should continue if one of the documents causes
an error.durability
- The durability for the insert.documents
- The documents to add to the collection.-1
.MongoDbException
- On an error inserting the documents.void insertAsync(Callback<Integer> results, boolean continueOnError, DocumentAssignable... documents) throws MongoDbException
results
- Callback
that will be notified with the results of the
insert. Currently, the value is always zero. Once SERVER-4381 is fixed then expected to be the number of
documents inserted. If the durability is NONE then returns
-1
.continueOnError
- If the insert should continue if one of the documents causes
an error.documents
- The documents to add to the collection.MongoDbException
- On an error inserting the documents.void insertAsync(Callback<Integer> results, boolean continueOnError, Durability durability, DocumentAssignable... documents) throws MongoDbException
results
- Callback
that will be notified with the results of the
insert. Currently, the value is always zero. Once SERVER-4381 is fixed then expected to be the number of
documents inserted. If the durability is NONE then returns
-1
.continueOnError
- If the insert should continue if one of the documents causes
an error.durability
- The durability for the insert.documents
- The documents to add to the collection.MongoDbException
- On an error inserting the documents.void insertAsync(Callback<Integer> results, DocumentAssignable... documents) throws MongoDbException
results
- Callback
that will be notified with the results of the
insert. Currently, the value is always zero. Once SERVER-4381 is fixed then expected to be the number of
documents inserted. If the durability is NONE then returns
-1
.documents
- The documents to add to the collection.MongoDbException
- On an error inserting the documents.void insertAsync(Callback<Integer> results, Durability durability, DocumentAssignable... documents) throws MongoDbException
results
- Callback
that will be notified with the results of the
insert. Currently, the value is always zero. Once SERVER-4381 is fixed then expected to be the number of
documents inserted. If the durability is NONE then returns
-1
.durability
- The durability for the insert.documents
- The documents to add to the collection.MongoDbException
- On an error inserting the documents.ListenableFuture<Integer> insertAsync(DocumentAssignable... documents) throws MongoDbException
documents
- The documents to add to the collection.-1
.MongoDbException
- On an error inserting the documents.ListenableFuture<Integer> insertAsync(Durability durability, DocumentAssignable... documents) throws MongoDbException
durability
- The durability for the insert.documents
- The documents to add to the collection.-1
.MongoDbException
- On an error inserting the documents.void insertAsync(LambdaCallback<Integer> results, boolean continueOnError, DocumentAssignable... documents) throws MongoDbException
results
- Callback
that will be notified with the results of the
insert. Currently, the value is always zero. Once SERVER-4381 is fixed then expected to be the number of
documents inserted. If the durability is NONE then returns
-1
.continueOnError
- If the insert should continue if one of the documents causes
an error.documents
- The documents to add to the collection.MongoDbException
- On an error inserting the documents.void insertAsync(LambdaCallback<Integer> results, boolean continueOnError, Durability durability, DocumentAssignable... documents) throws MongoDbException
results
- Callback
that will be notified with the results of the
insert. Currently, the value is always zero. Once SERVER-4381 is fixed then expected to be the number of
documents inserted. If the durability is NONE then returns
-1
.continueOnError
- If the insert should continue if one of the documents causes
an error.durability
- The durability for the insert.documents
- The documents to add to the collection.MongoDbException
- On an error inserting the documents.void insertAsync(LambdaCallback<Integer> results, DocumentAssignable... documents) throws MongoDbException
results
- Callback
that will be notified with the results of the
insert. Currently, the value is always zero. Once SERVER-4381 is fixed then expected to be the number of
documents inserted. If the durability is NONE then returns
-1
.documents
- The documents to add to the collection.MongoDbException
- On an error inserting the documents.void insertAsync(LambdaCallback<Integer> results, Durability durability, DocumentAssignable... documents) throws MongoDbException
results
- Callback
that will be notified with the results of the
insert. Currently, the value is always zero. Once SERVER-4381 is fixed then expected to be the number of
documents inserted. If the durability is NONE then returns
-1
.durability
- The durability for the insert.documents
- The documents to add to the collection.MongoDbException
- On an error inserting the documents.void mapReduceAsync(Callback<MongoIterator<Document>> results, MapReduce command) throws MongoDbException
results
- Callback for the map/reduce results returned. Note this might
be empty if the output type is not inline.command
- The details of the map/reduce request.MongoDbException
- On an error finding the documents.void mapReduceAsync(Callback<MongoIterator<Document>> results, MapReduce.Builder command) throws MongoDbException
results
- Callback for the map/reduce results returned. Note this might
be empty if the output type is not inline.command
- The details of the map/reduce request.MongoDbException
- On an error finding the documents.void mapReduceAsync(LambdaCallback<MongoIterator<Document>> results, MapReduce command) throws MongoDbException
results
- Callback for the map/reduce results returned. Note this might
be empty if the output type is not inline.command
- The details of the map/reduce request.MongoDbException
- On an error finding the documents.void mapReduceAsync(LambdaCallback<MongoIterator<Document>> results, MapReduce.Builder command) throws MongoDbException
results
- Callback for the map/reduce results returned. Note this might
be empty if the output type is not inline.command
- The details of the map/reduce request.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Document>> mapReduceAsync(MapReduce command) throws MongoDbException
command
- The details of the map/reduce request.MongoDbException
- On an error finding the documents.ListenableFuture<MongoIterator<Document>> mapReduceAsync(MapReduce.Builder command) throws MongoDbException
command
- The details of the map/reduce request.MongoDbException
- On an error finding the documents.void parallelScanAsync(Callback<Collection<MongoIterator<Document>>> results, ParallelScan parallelScan) throws MongoDbException
parallelCollectionScan
command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. You may then use a separate thread to scan each region
of the collection in parallel.results
- Callback for the collection of iterators.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.void parallelScanAsync(Callback<Collection<MongoIterator<Document>>> results, ParallelScan.Builder parallelScan) throws MongoDbException
parallelCollectionScan
command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. You may then use a separate thread to scan each region
of the collection in parallel.results
- Callback for the collection of iterators.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.void parallelScanAsync(LambdaCallback<Collection<MongoIterator<Document>>> results, ParallelScan parallelScan) throws MongoDbException
parallelCollectionScan
command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. You may then use a separate thread to scan each region
of the collection in parallel.results
- Callback for the collection of iterators.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.void parallelScanAsync(LambdaCallback<Collection<MongoIterator<Document>>> results, ParallelScan.Builder parallelScan) throws MongoDbException
parallelCollectionScan
command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. You may then use a separate thread to scan each region
of the collection in parallel.results
- Callback for the collection of iterators.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.ListenableFuture<Collection<MongoIterator<Document>>> parallelScanAsync(ParallelScan parallelScan) throws MongoDbException
parallelCollectionScan
command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. You may then use a separate thread to scan each region
of the collection in parallel.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.ListenableFuture<Collection<MongoIterator<Document>>> parallelScanAsync(ParallelScan.Builder parallelScan) throws MongoDbException
parallelCollectionScan
command to open multiple
iterators over the collection each configured to scan a distinct regions
of the collection. You may then use a separate thread to scan each region
of the collection in parallel.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.void saveAsync(Callback<Integer> results, DocumentAssignable document) throws MongoDbException
document
to the collection.
If the document
does not contain an _id
field then this
method is equivalent to:
insertAsync(results,
document)
.
If the document
does contain an _id
field then this
method is equivalent to:
updateAsync(results, BuilderFactory.start().add(document.get("_id")),
document, false, true)
.
results
- Callback
that will be notified with the results of the
insert. If the durability of the operation is NONE then this
will be -1.document
- The document to save to the collection.MongoDbException
- On an error saving the documents.void saveAsync(Callback<Integer> results, DocumentAssignable document, Durability durability) throws MongoDbException
document
to the collection.
If the document
does not contain an _id
field then this
method is equivalent to:
insertAsync(results, durability, document)
.
If the document
does contain an _id
field then this
method is equivalent to:
updateAsync(results, BuilderFactory.start().add(document.get("_id")),
document, false, true, durability)
.
results
- Callback
that will be notified with the results of the
insert. If the durability of the operation is NONE then this
will be -1.document
- The document to save to the collection.durability
- The durability for the save.MongoDbException
- On an error saving the documents.ListenableFuture<Integer> saveAsync(DocumentAssignable document) throws MongoDbException
document
to the collection.
If the document
does not contain an _id
field then this
method is equivalent to: insertAsync(document)
.
If the document
does contain an _id
field then this
method is equivalent to:
updateAsync(BuilderFactory.start().add(document.get("_id")), document,
false, true)
.
document
- The document to save to the collection.MongoDbException
- On an error saving the documents.ListenableFuture<Integer> saveAsync(DocumentAssignable document, Durability durability) throws MongoDbException
document
to the collection.
If the document
does not contain an _id
field then this
method is equivalent to:
insertAsync(durability, document)
.
If the document
does contain an _id
field then this
method is equivalent to:
updateAsync(BuilderFactory.start().add(document.get("_id")), document,
false, true, durability)
.
document
- The document to save to the collection.durability
- The durability for the save.MongoDbException
- On an error saving the documents.void saveAsync(LambdaCallback<Integer> results, DocumentAssignable document) throws MongoDbException
document
to the collection.
If the document
does not contain an _id
field then this
method is equivalent to:
insertAsync(results,
document)
.
If the document
does contain an _id
field then this
method is equivalent to:
updateAsync(results, BuilderFactory.start().add(document.get("_id")),
document, false, true)
.
results
- Callback
that will be notified with the results of the
insert. If the durability of the operation is NONE then this
will be -1.document
- The document to save to the collection.MongoDbException
- On an error saving the documents.void saveAsync(LambdaCallback<Integer> results, DocumentAssignable document, Durability durability) throws MongoDbException
document
to the collection.
If the document
does not contain an _id
field then this
method is equivalent to:
insertAsync(results, durability, document)
.
If the document
does contain an _id
field then this
method is equivalent to:
updateAsync(results, BuilderFactory.start().add(document.get("_id")),
document, false, true, durability)
.
results
- Callback
that will be notified with the results of the
insert. If the durability of the operation is NONE then this
will be -1.document
- The document to save to the collection.durability
- The durability for the save.MongoDbException
- On an error saving the documents.MongoCursorControl stream(LambdaCallback<Document> results, Aggregate aggregation) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.accept(...)
method with null
for both parameters or by calling the
method with an error for the first parameter.
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.aggregation
- The aggregation details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl stream(LambdaCallback<Document> results, Aggregate.Builder aggregation) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.accept(...)
method with null
for both parameters or by calling the
method with an error for the first parameter.
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
This method is equivalent to stream( results, aggregation.build() )
.
results
- Callback that will be notified of the results of the query.aggregation
- The aggregation details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl stream(LambdaCallback<Document> results, Find query) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.accept(...)
method with null
for both parameters or by calling the
method with an error for the first parameter.
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl stream(LambdaCallback<Document> results, Find.Builder query) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.accept(...)
method with null
for both parameters or by calling the
method with an error for the first parameter.
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl stream(StreamCallback<Document> results, Aggregate aggregation) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.done()
method or by calling the
results.exception(...)
method
(in the event of an error).
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.aggregation
- The aggregation details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl stream(StreamCallback<Document> results, Aggregate.Builder aggregation) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.done()
method or by calling the
results.exception(...)
method
(in the event of an error).
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
This method is equivalent to stream( results, aggregation.build() )
.
results
- Callback that will be notified of the results of the query.aggregation
- The aggregation details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl stream(StreamCallback<Document> results, Find query) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.done()
method or by calling the
results.exception(...)
method
(in the event of an error).
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl stream(StreamCallback<Document> results, Find.Builder query) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.done()
method or by calling the
results.exception(...)
method
(in the event of an error).
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.@Deprecated MongoCursorControl streamingFind(Callback<Document> results, DocumentAssignable query) throws MongoDbException
streamingFind(StreamCallback, DocumentAssignable)
method instead. This method will be removed after the 1.3.0
release.
The sequence of callbacks will be terminated by either calling the
results.callback(...)
method with
null
or by calling the results.exception(...)
method on an error.
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method (which
will then call the Callback.exception(java.lang.Throwable)
method).
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query document.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.@Deprecated MongoCursorControl streamingFind(Callback<Document> results, Find query) throws MongoDbException
stream(StreamCallback, Find)
method instead.
This method will be removed after the 1.3.0 release.
The sequence of callbacks will be terminated by either calling the
results.callback(...)
method with
null
or by calling the results.exception(...)
method on an error.
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method (which
will then call the Callback.exception(java.lang.Throwable)
method).
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl streamingFind(LambdaCallback<Document> results, DocumentAssignable query) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.accept(...)
method with null
for both parameters or by calling the
method with an error for the first parameter.
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query document.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.MongoCursorControl streamingFind(StreamCallback<Document> results, DocumentAssignable query) throws MongoDbException
The sequence of callbacks will be terminated by either calling the
results.done()
method or by calling the
results.exception(...)
method
(in the event of an error).
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query document.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.@Deprecated MongoCursorControl streamingFind(StreamCallback<Document> results, Find query) throws MongoDbException
stream(StreamCallback, Find)
method instead.
This method will be removed after the 1.4.0 release.
The sequence of callbacks will be terminated by either calling the
results.done()
method or by calling the
results.exception(...)
method
(in the event of an error).
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.@Deprecated MongoCursorControl streamingFind(StreamCallback<Document> results, Find.Builder query) throws MongoDbException
stream(StreamCallback, Find.Builder)
method
instead. This method will be removed after the 1.4.0 release.
The sequence of callbacks will be terminated by either calling the
results.done()
method or by calling the
results.exception(...)
method
(in the event of an error).
Applications can terminate the stream by throwing a
RuntimeException
from the Callback.callback(V)
method
(which will then call the Callback.exception(java.lang.Throwable)
method or by
closing the MongoCursorControl
returned from this method.
Only a single thread will invoke the callback at a time but that thread may change over time.
If the callback processing requires any significant time (including I/O)
it is recommended that an
Executor
be configured within the MongoClientConfiguration
to
off-load the processing from the receive thread.
results
- Callback that will be notified of the results of the query.query
- The query details.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.MongoDbException
- On an error finding the documents.@Deprecated void textSearchAsync(Callback<MongoIterator<TextResult>> results, Text command) throws MongoDbException
text
command was deprecated in the
2.6 version of MongoDB. Use the
$text
query operator
instead. This method will not be removed until two releases
after the MongoDB 2.6 release (e.g. 2.10 if the releases are
2.8 and 2.10).text
command on the server.results
- Callback for the text
results returned.command
- The details of the text
request.MongoDbException
- On an error executing the text
command.@Deprecated void textSearchAsync(Callback<MongoIterator<TextResult>> results, Text.Builder command) throws MongoDbException
text
command was deprecated in the
2.6 version of MongoDB. Use the
$text
query operator
instead. This method will not be removed until two releases
after the MongoDB 2.6 release (e.g. 2.10 if the releases are
2.8 and 2.10).text
command on the server.results
- Callback for the text
results returned.command
- The details of the text
request.MongoDbException
- On an error executing the text
command.@Deprecated ListenableFuture<MongoIterator<TextResult>> textSearchAsync(Text command) throws MongoDbException
text
command was deprecated in the
2.6 version of MongoDB. Use the
$text
query operator
instead. This method will not be removed until two releases
after the MongoDB 2.6 release (e.g. 2.10 if the releases are
2.8 and 2.10).text
command on the server.command
- The details of the text
request.text
results returned.MongoDbException
- On an error executing the text
command.@Deprecated ListenableFuture<MongoIterator<TextResult>> textSearchAsync(Text.Builder command) throws MongoDbException
text
command was deprecated in the
2.6 version of MongoDB. Use the
$text
query operator
instead. This method will not be removed until two releases
after the MongoDB 2.6 release (e.g. 2.10 if the releases are
2.8 and 2.10).text
command on the server.command
- The details of the text
request.text
results returned.MongoDbException
- On an error executing the text
command.void updateAsync(Callback<Long> results, DocumentAssignable query, DocumentAssignable update) throws MongoDbException
results
- The Callback
that will be notified of the number of
documents updated. If the durability of the operation is NONE
then this will be -1.query
- The query to select the documents to update.update
- The updates to apply to the selected documents.MongoDbException
- On an error updating the documents.void updateAsync(Callback<Long> results, DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert) throws MongoDbException
results
- The Callback
that will be notified of the number of
documents updated. If the durability of the operation is NONE
then this will be -1.query
- The query to select the documents to update.update
- The updates to apply to the selected documents.multiUpdate
- If true then the update is applied to all of the matching
documents, otherwise only the first document found is updated.upsert
- If true then if no document is found then a new document is
created and updated, otherwise no operation is performed.MongoDbException
- On an error updating the documents.void updateAsync(Callback<Long> results, DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert, Durability durability) throws MongoDbException
results
- The Callback
that will be notified of the number of
documents updated. If the durability of the operation is NONE
then this will be -1.query
- The query to select the documents to update.update
- The updates to apply to the selected documents.multiUpdate
- If true then the update is applied to all of the matching
documents, otherwise only the first document found is updated.upsert
- If true then if no document is found then a new document is
created and updated, otherwise no operation is performed.durability
- The durability for the update.MongoDbException
- On an error updating the documents.void updateAsync(Callback<Long> results, DocumentAssignable query, DocumentAssignable update, Durability durability) throws MongoDbException
results
- The Callback
that will be notified of the number of
documents updated. If the durability of the operation is NONE
then this will be -1.query
- The query to select the documents to update.update
- The updates to apply to the selected documents.durability
- The durability for the update.MongoDbException
- On an error updating the documents.ListenableFuture<Long> updateAsync(DocumentAssignable query, DocumentAssignable update) throws MongoDbException
query
- The query to select the documents to update.update
- The updates to apply to the selected documents.ListenableFuture
that will be updated with the number
of documents updated. If the durability of the operation is NONE
then this will be -1.MongoDbException
- On an error updating the documents.ListenableFuture<Long> updateAsync(DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert) throws MongoDbException
query
- The query to select the documents to update.update
- The updates to apply to the selected documents.multiUpdate
- If true then the update is applied to all of the matching
documents, otherwise only the first document found is updated.upsert
- If true then if no document is found then a new document is
created and updated, otherwise no operation is performed.ListenableFuture
that will be updated with the number
of documents updated. If the durability of the operation is NONE
then this will be -1.MongoDbException
- On an error updating the documents.ListenableFuture<Long> updateAsync(DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert, Durability durability) throws MongoDbException
query
- The query to select the documents to update.update
- The updates to apply to the selected documents.multiUpdate
- If true then the update is applied to all of the matching
documents, otherwise only the first document found is updated.upsert
- If true then if no document is found then a new document is
created and updated, otherwise no operation is performed.durability
- The durability for the update.ListenableFuture
that will be updated with the number
of documents updated. If the durability of the operation is NONE
then this will be -1.MongoDbException
- On an error updating the documents.ListenableFuture<Long> updateAsync(DocumentAssignable query, DocumentAssignable update, Durability durability) throws MongoDbException
query
- The query to select the documents to update.update
- The updates to apply to the selected documents.durability
- The durability for the update.ListenableFuture
that will be updated with the number
of documents updated. If the durability of the operation is NONE
then this will be -1.MongoDbException
- On an error updating the documents.void updateAsync(LambdaCallback<Long> results, DocumentAssignable query, DocumentAssignable update) throws MongoDbException
results
- The LambdaCallback
that will be notified of the number
of documents updated. If the durability of the operation is
NONE then this will be -1.query
- The query to select the documents to update.update
- The updates to apply to the selected documents.MongoDbException
- On an error updating the documents.void updateAsync(LambdaCallback<Long> results, DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert) throws MongoDbException
results
- The LambdaCallback
that will be notified of the number
of documents updated. If the durability of the operation is
NONE then this will be -1.query
- The query to select the documents to update.update
- The updates to apply to the selected documents.multiUpdate
- If true then the update is applied to all of the matching
documents, otherwise only the first document found is updated.upsert
- If true then if no document is found then a new document is
created and updated, otherwise no operation is performed.MongoDbException
- On an error updating the documents.void updateAsync(LambdaCallback<Long> results, DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert, Durability durability) throws MongoDbException
results
- The LambdaCallback
that will be notified of the number
of documents updated. If the durability of the operation is
NONE then this will be -1.query
- The query to select the documents to update.update
- The updates to apply to the selected documents.multiUpdate
- If true then the update is applied to all of the matching
documents, otherwise only the first document found is updated.upsert
- If true then if no document is found then a new document is
created and updated, otherwise no operation is performed.durability
- The durability for the update.MongoDbException
- On an error updating the documents.void updateAsync(LambdaCallback<Long> results, DocumentAssignable query, DocumentAssignable update, Durability durability) throws MongoDbException
results
- The LambdaCallback
that will be notified of the number
of documents updated. If the durability of the operation is
NONE then this will be -1.query
- The query to select the documents to update.update
- The updates to apply to the selected documents.durability
- The durability for the update.MongoDbException
- On an error updating the documents.ListenableFuture<Long> writeAsync(BatchedWrite write) throws MongoDbException
If connected to a cluster where all servers can accept write commands then the operations will be sent to the server using the write commands. If the cluster does not support the write command then the operations will be converted to a series of native write operations.
Since this method may use the write commands a Durability
of
Durability.NONE
will be changed to Durability.ACK
.
write
- The batched writesreturn
for
the insertAsync(DocumentAssignable...)
method applies.MongoDbException
- On an error submitting the write operations.BatchedWrite.REQUIRED_VERSION
ListenableFuture<Long> writeAsync(BatchedWrite.Builder write) throws MongoDbException
If connected to a cluster where all servers can accept write commands then the operations will be sent to the server using the write commands. If the cluster does not support the write command then the operations will be converted to a series of native write operations.
Since this method may use the write commands a Durability
of
Durability.NONE
will be changed to Durability.ACK
.
write
- The batched writesreturn
for
the insertAsync(DocumentAssignable...)
method applies.MongoDbException
- On an error submitting the write operations.BatchedWrite.REQUIRED_VERSION
void writeAsync(Callback<Long> results, BatchedWrite write) throws MongoDbException
If connected to a cluster where all servers can accept write commands then the operations will be sent to the server using the write commands. If the cluster does not support the write command then the operations will be converted to a series of native write operations.
Since this method may use the write commands a Durability
of
Durability.NONE
will be changed to Durability.ACK
.
results
- The Callback
that will be notified of the number of
documents inserted, updated, and deleted. If this method falls
back to the native write commands then the notice for the
results
parameter for the
insertAsync(Callback, DocumentAssignable...)
method
applies.write
- The batched writesMongoDbException
- On an error submitting the write operations.BatchedWrite.REQUIRED_VERSION
void writeAsync(Callback<Long> results, BatchedWrite.Builder write) throws MongoDbException
If connected to a cluster where all servers can accept write commands then the operations will be sent to the server using the write commands. If the cluster does not support the write command then the operations will be converted to a series of native write operations.
Since this method may use the write commands a Durability
of
Durability.NONE
will be changed to Durability.ACK
.
results
- The Callback
that will be notified of the number of
documents inserted, updated, and deleted. If this method falls
back to the native write commands then the notice for the
results
parameter for the
insertAsync(Callback, DocumentAssignable...)
method
applies.write
- The batched writesMongoDbException
- On an error submitting the write operations.BatchedWrite.REQUIRED_VERSION
void writeAsync(LambdaCallback<Long> results, BatchedWrite write) throws MongoDbException
If connected to a cluster where all servers can accept write commands then the operations will be sent to the server using the write commands. If the cluster does not support the write command then the operations will be converted to a series of native write operations.
Since this method may use the write commands a Durability
of
Durability.NONE
will be changed to Durability.ACK
.
results
- The Callback
that will be notified of the number of
documents inserted, updated, and deleted. If this method falls
back to the native write commands then the notice for the
results
parameter for the
insertAsync(Callback, DocumentAssignable...)
method
applies.write
- The batched writesMongoDbException
- On an error submitting the write operations.BatchedWrite.REQUIRED_VERSION
void writeAsync(LambdaCallback<Long> results, BatchedWrite.Builder write) throws MongoDbException
If connected to a cluster where all servers can accept write commands then the operations will be sent to the server using the write commands. If the cluster does not support the write command then the operations will be converted to a series of native write operations.
Since this method may use the write commands a Durability
of
Durability.NONE
will be changed to Durability.ACK
.
results
- The Callback
that will be notified of the number of
documents inserted, updated, and deleted. If this method falls
back to the native write commands then the notice for the
results
parameter for the
insertAsync(Callback, DocumentAssignable...)
method
applies.write
- The batched writesMongoDbException
- On an error submitting the write operations.BatchedWrite.REQUIRED_VERSION
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.