public abstract class AbstractAsyncMongoCollection extends AbstractMongoOperations implements AsyncMongoCollection
This class keeps the clutter in the derived class to a minimum and also deals with the conversion of the asynchronous method invocations into synchronous methods for those uses cases that do not require an asynchronous interface.
DELETE_SINGLE_DELETE_DEFAULT, EMPTY_INDEX_OPTIONS, ID_FIELD_NAME, INSERT_CONTINUE_ON_ERROR_DEFAULT, myClient, myDatabase, myName, UNIQUE_INDEX_OPTIONS, UPDATE_MULTIUPDATE_DEFAULT, UPDATE_UPSERT_DEFAULT
ALL, NONE
Constructor and Description |
---|
AbstractAsyncMongoCollection(Client client,
MongoDatabase database,
String name)
Create a new AbstractAsyncMongoCollection.
|
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(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,
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,
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.
|
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,
Find.Builder 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.
|
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.
|
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.
|
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.
|
protected LockType |
getLockType()
Returns the type of lock to use.
|
void |
groupByAsync(Callback<MongoIterator<Element>> results,
GroupBy.Builder 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,
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(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(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. |
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 aggregation)
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,
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 |
streamingFind(Callback<Document> results,
DocumentAssignable query)
Deprecated.
|
MongoCursorControl |
streamingFind(Callback<Document> results,
Find query)
Deprecated.
|
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.
|
MongoCursorControl |
streamingFind(StreamCallback<Document> results,
Find query)
Deprecated.
|
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). |
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,
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(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.
|
aggregateAsync, asGetLastError, countAsync, createQuery, deleteAsync, distinctAsync, doInsertAsync, doWriteAsync, explainAsync, explainAsync, findAndModifyAsync, findAsync, findOneAsync, getDatabaseName, getDurability, getName, getReadPreference, groupByAsync, insertAsync, isWriteCommandsSupported, mapReduceAsync, parallelScanAsync, saveAsync, setDurability, setReadPreference, stream, stream, textSearchAsync, toCommand, updateAsync, updateReadPreference, useWriteCommand, writeAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aggregateAsync, countAsync, deleteAsync, distinctAsync, explainAsync, explainAsync, findAndModifyAsync, findAsync, findOneAsync, groupByAsync, insertAsync, mapReduceAsync, parallelScanAsync, saveAsync, stream, stream, textSearchAsync, updateAsync, writeAsync
public AbstractAsyncMongoCollection(Client client, MongoDatabase database, String name)
client
- The client for interacting with MongoDB.database
- The database we interact with.name
- The name of the collection we interact with.public ListenableFuture<MongoIterator<Document>> aggregateAsync(Aggregate command) throws MongoDbException
Overridden to call the AbstractMongoOperations.aggregateAsync(Callback, Aggregate)
.
aggregateAsync
in interface AsyncMongoCollection
command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.AbstractMongoOperations.aggregateAsync(Callback, Aggregate)
public ListenableFuture<MongoIterator<Document>> aggregateAsync(Aggregate.Builder command) throws MongoDbException
Overridden to call the aggregateAsync(Aggregate)
.
aggregateAsync
in interface AsyncMongoCollection
command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.public void aggregateAsync(Callback<MongoIterator<Document>> results, Aggregate.Builder command) throws MongoDbException
Overridden to call the AbstractMongoOperations.aggregateAsync(Callback, Aggregate)
.
aggregateAsync
in interface AsyncMongoCollection
results
- Callback for the aggregation results returned.command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.public void aggregateAsync(LambdaCallback<MongoIterator<Document>> results, Aggregate command) throws MongoDbException
Overridden to call the AbstractMongoOperations.aggregateAsync(Callback, Aggregate)
method with an adapter for the LambdaCallback
.
aggregateAsync
in interface AsyncMongoCollection
results
- Callback for the aggregation results returned.command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.public void aggregateAsync(LambdaCallback<MongoIterator<Document>> results, Aggregate.Builder command) throws MongoDbException
Overridden to call the
aggregateAsync(Callback, Aggregate.Builder)
method with an
adapter for the LambdaCallback
.
aggregateAsync
in interface AsyncMongoCollection
results
- Callback for the aggregation results returned.command
- The details of the aggregation request.MongoDbException
- On an error executing the aggregate command.public ListenableFuture<Long> countAsync() throws MongoDbException
This is equivalent to calling countAsync().get()
Overridden to call the
countAsync(DocumentAssignable,ReadPreference)
method with
AbstractMongoOperations.getReadPreference()
as the readPreference argument and
an empty query
document.
countAsync
in interface AsyncMongoCollection
MongoDbException
- On an error finding the documents.public void countAsync(Callback<Long> results) throws MongoDbException
This is equivalent to calling
countAsync(results,
BuilderFactory.start())
Overridden to call the
countAsync(Callback,DocumentAssignable,ReadPreference)
method
with AbstractMongoOperations.getReadPreference()
as the readPreference argument
and an empty query
document.
countAsync
in interface AsyncMongoCollection
results
- The callback to notify of the results.MongoDbException
- On an error finding the documents.public void countAsync(Callback<Long> results, Count.Builder count) throws MongoDbException
Overridden to call the countAsync(results, count.build())
.
countAsync
in interface AsyncMongoCollection
results
- The callback to notify of the results.count
- The count command.MongoDbException
- On an error counting the documents.public void countAsync(Callback<Long> results, DocumentAssignable query) throws MongoDbException
Overridden to call the
countAsync(Callback, DocumentAssignable, ReadPreference)
method
with AbstractMongoOperations.getReadPreference()
as the readPreference
argument.
countAsync
in interface AsyncMongoCollection
results
- The callback to notify of the results.query
- The query document.MongoDbException
- On an error finding the documents.public void countAsync(Callback<Long> results, DocumentAssignable query, ReadPreference readPreference) throws MongoDbException
Overridden to call the AbstractMongoOperations.countAsync(Callback, Count)
method with
the query and read preferences set.
countAsync
in interface AsyncMongoCollection
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.public void countAsync(Callback<Long> results, ReadPreference readPreference) throws MongoDbException
This is equivalent to calling
countAsync(results,
BuilderFactory.start(), readPreference)
Overridden to call the
countAsync(Callback,DocumentAssignable,ReadPreference)
method
with an empty query
document.
countAsync
in interface AsyncMongoCollection
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.public ListenableFuture<Long> countAsync(Count count) throws MongoDbException
Overridden to call the AbstractMongoOperations.countAsync(Callback, Count)
.
countAsync
in interface AsyncMongoCollection
count
- The count command.MongoDbException
- On an error counting the documents.public ListenableFuture<Long> countAsync(Count.Builder count) throws MongoDbException
Overridden to call the countAsync(count.build())
.
countAsync
in interface AsyncMongoCollection
count
- The count command.MongoDbException
- On an error counting the documents.public ListenableFuture<Long> countAsync(DocumentAssignable query) throws MongoDbException
Overridden to call the
countAsync(Callback, DocumentAssignable, ReadPreference)
method
with AbstractMongoOperations.getReadPreference()
as the readPreference
argument.
countAsync
in interface AsyncMongoCollection
query
- The query document.MongoDbException
- On an error finding the documents.public ListenableFuture<Long> countAsync(DocumentAssignable query, ReadPreference readPreference) throws MongoDbException
Overridden to call the
countAsync(Callback, DocumentAssignable, ReadPreference)
method.
countAsync
in interface AsyncMongoCollection
query
- The query document.readPreference
- The preference for which servers to use to retrieve the
results.MongoDbException
- On an error finding the documents.public void countAsync(LambdaCallback<Long> results) throws MongoDbException
This is equivalent to calling
countAsync(results, BuilderFactory.start())
Overridden to call the countAsync(Callback)
method with an
adapter for the LambdaCallback
.
countAsync
in interface AsyncMongoCollection
results
- The callback to notify of the results.MongoDbException
- On an error finding the documents.public void countAsync(LambdaCallback<Long> results, Count count) throws MongoDbException
Overridden to call the AbstractMongoOperations.countAsync(Callback, Count)
method with
an adapter for the LambdaCallback
.
countAsync
in interface AsyncMongoCollection
results
- The callback to notify of the results.count
- The count command.MongoDbException
- On an error counting the documents.public void countAsync(LambdaCallback<Long> results, Count.Builder count) throws MongoDbException
Overridden to call the countAsync(Callback, Count.Builder)
method with an adapter for the LambdaCallback
.
countAsync
in interface AsyncMongoCollection
results
- The callback to notify of the results.count
- The count command.MongoDbException
- On an error counting the documents.public void countAsync(LambdaCallback<Long> results, DocumentAssignable query) throws MongoDbException
Overridden to call the countAsync(Callback, DocumentAssignable)
method with an adapter for the LambdaCallback
.
countAsync
in interface AsyncMongoCollection
results
- The callback to notify of the results.query
- The query document.MongoDbException
- On an error finding the documents.public void countAsync(LambdaCallback<Long> results, DocumentAssignable query, ReadPreference readPreference) throws MongoDbException
Overridden to call the
countAsync(Callback, DocumentAssignable, ReadPreference)
method
with an adapter for the LambdaCallback
.
countAsync
in interface AsyncMongoCollection
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.public void countAsync(LambdaCallback<Long> results, ReadPreference readPreference) throws MongoDbException
This is equivalent to calling
countAsync(results, BuilderFactory.start(), readPreference)
Overridden to call the countAsync(Callback, ReadPreference)
method with an adapter for the LambdaCallback
.
countAsync
in interface AsyncMongoCollection
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.public ListenableFuture<Long> countAsync(ReadPreference readPreference) throws MongoDbException
This is equivalent to calling countAsync().get()
Overridden to call the
countAsync(DocumentAssignable,ReadPreference)
method with an
empty query
document.
countAsync
in interface AsyncMongoCollection
readPreference
- The preference for which servers to use to retrieve the
results.MongoDbException
- On an error finding the documents.public void deleteAsync(Callback<Long> results, DocumentAssignable query) throws MongoDbException
Overridden to call the
AbstractMongoOperations.deleteAsync(Callback, DocumentAssignable, boolean, Durability)
method with false as the singleDelete argument and the
default durability
.
deleteAsync
in interface AsyncMongoCollection
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.AbstractMongoOperations.deleteAsync(Callback, DocumentAssignable, boolean, Durability)
public void deleteAsync(Callback<Long> results, DocumentAssignable query, boolean singleDelete) throws MongoDbException
Overridden to call the
AbstractMongoOperations.deleteAsync(Callback, DocumentAssignable, boolean, Durability)
method with the default durability
.
deleteAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.deleteAsync(Callback, DocumentAssignable)
public void deleteAsync(Callback<Long> results, DocumentAssignable query, Durability durability) throws MongoDbException
Overridden to call the
AbstractMongoOperations.deleteAsync(Callback, DocumentAssignable, boolean, Durability)
method with false as the singleDelete argument.
deleteAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.deleteAsync(Callback, DocumentAssignable, boolean)
public ListenableFuture<Long> deleteAsync(DocumentAssignable query) throws MongoDbException
Overridden to call the
AbstractMongoOperations.deleteAsync(Callback, DocumentAssignable, boolean, Durability)
method with false as the singleDelete argument and the
default durability
.
deleteAsync
in interface AsyncMongoCollection
query
- Query to locate the documents to be deleted.MongoDbException
- On an error deleting the documents.AsyncMongoCollection.deleteAsync(Callback, DocumentAssignable)
public ListenableFuture<Long> deleteAsync(DocumentAssignable query, boolean singleDelete) throws MongoDbException
Overridden to call the
AbstractMongoOperations.deleteAsync(Callback, DocumentAssignable, boolean, Durability)
method with the default durability
.
deleteAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.deleteAsync(Callback, DocumentAssignable)
public ListenableFuture<Long> deleteAsync(DocumentAssignable query, boolean singleDelete, Durability durability) throws MongoDbException
Overridden to call the deleteAsync(Callback, DocumentAssignable)
method.
deleteAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.deleteAsync(Callback, DocumentAssignable)
public ListenableFuture<Long> deleteAsync(DocumentAssignable query, Durability durability) throws MongoDbException
Overridden to call the deleteAsync(Callback, DocumentAssignable)
method with false as the singleDelete argument.
deleteAsync
in interface AsyncMongoCollection
query
- Query to locate the documents to be deleted.durability
- The durability for the delete.MongoDbException
- On an error deleting the documents.AsyncMongoCollection.deleteAsync(Callback, DocumentAssignable)
public void deleteAsync(LambdaCallback<Long> results, DocumentAssignable query) throws MongoDbException
Overridden to call the deleteAsync(Callback, DocumentAssignable)
method with an adapter for the LambdaCallback
.
deleteAsync
in interface AsyncMongoCollection
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.public void deleteAsync(LambdaCallback<Long> results, DocumentAssignable query, boolean singleDelete) throws MongoDbException
Overridden to call the
deleteAsync(Callback, DocumentAssignable, boolean)
method with
an adapter for the LambdaCallback
.
deleteAsync
in interface AsyncMongoCollection
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.public void deleteAsync(LambdaCallback<Long> results, DocumentAssignable query, boolean singleDelete, Durability durability) throws MongoDbException
Overridden to call the
AbstractMongoOperations.deleteAsync(Callback, DocumentAssignable, boolean, Durability)
method with an adapter for the LambdaCallback
.
deleteAsync
in interface AsyncMongoCollection
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.public void deleteAsync(LambdaCallback<Long> results, DocumentAssignable query, Durability durability) throws MongoDbException
Overridden to call the
deleteAsync(Callback, DocumentAssignable, Durability)
method
with an adapter for the LambdaCallback
.
deleteAsync
in interface AsyncMongoCollection
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.public void distinctAsync(Callback<MongoIterator<Element>> results, Distinct.Builder command) throws MongoDbException
Overridden to call the AbstractMongoOperations.distinctAsync(Callback, Distinct)
.
distinctAsync
in interface AsyncMongoCollection
results
- Callback for the distinct results returned.command
- The details of the distinct request.MongoDbException
- On an error finding the documents.public ListenableFuture<MongoIterator<Element>> distinctAsync(Distinct command) throws MongoDbException
Overridden to call the AbstractMongoOperations.distinctAsync(Callback, Distinct)
.
distinctAsync
in interface AsyncMongoCollection
command
- The details of the distinct request.MongoDbException
- On an error finding the documents.public ListenableFuture<MongoIterator<Element>> distinctAsync(Distinct.Builder command) throws MongoDbException
Overridden to call the distinctAsync(Distinct)
.
distinctAsync
in interface AsyncMongoCollection
command
- The details of the distinct request.MongoDbException
- On an error finding the documents.public void distinctAsync(LambdaCallback<MongoIterator<Element>> results, Distinct command) throws MongoDbException
Overridden to call the AbstractMongoOperations.distinctAsync(Callback, Distinct)
method
with an adapter for the LambdaCallback
.
distinctAsync
in interface AsyncMongoCollection
results
- Callback for the distinct results returned.command
- The details of the distinct request.MongoDbException
- On an error finding the documents.public void distinctAsync(LambdaCallback<MongoIterator<Element>> results, Distinct.Builder command) throws MongoDbException
Overridden to call the distinctAsync(Callback, Distinct.Builder)
method with an adapter for the LambdaCallback
.
distinctAsync
in interface AsyncMongoCollection
results
- Callback for the distinct results returned.command
- The details of the distinct request.MongoDbException
- On an error finding the documents.public ListenableFuture<Document> explainAsync(Aggregate aggregation) throws MongoDbException
Overridden to call the AbstractMongoOperations.explainAsync(Callback,Aggregate)
method.
explainAsync
in interface AsyncMongoCollection
aggregation
- The aggregation details.MongoDbException
- On an error finding the documents.public ListenableFuture<Document> explainAsync(Aggregate.Builder aggregation) throws MongoDbException
Overridden to call the AbstractMongoOperations.explainAsync(Callback,Aggregate)
method.
explainAsync
in interface AsyncMongoCollection
aggregation
- The aggregation details.MongoDbException
- On an error finding the documents.public void explainAsync(Callback<Document> results, Aggregate.Builder aggregation) throws MongoDbException
Overridden to call the AbstractMongoOperations.explainAsync(Callback,Aggregate)
method.
explainAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the explain.aggregation
- The aggregation details.MongoDbException
- On an error finding the documents.public void explainAsync(Callback<Document> results, Find.Builder query) throws MongoDbException
Overridden to call the AbstractMongoOperations.explainAsync(Callback,Find)
method.
explainAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the explain.query
- The query details.MongoDbException
- On an error finding the documents.public ListenableFuture<Document> explainAsync(Find query) throws MongoDbException
Overridden to call the AbstractMongoOperations.explainAsync(Callback,Find)
method.
explainAsync
in interface AsyncMongoCollection
query
- The query details.MongoDbException
- On an error finding the documents.AbstractMongoOperations.explainAsync(Callback,Find)
public ListenableFuture<Document> explainAsync(Find.Builder query) throws MongoDbException
Overridden to call the explainAsync(Find)
method.
explainAsync
in interface AsyncMongoCollection
query
- The query details.MongoDbException
- On an error finding the documents.public void explainAsync(LambdaCallback<Document> results, Aggregate aggregation) throws MongoDbException
Overridden to call the AbstractMongoOperations.explainAsync(Callback, Aggregate)
method
with an adapter for the LambdaCallback
.
explainAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the explain.aggregation
- The aggregation details.MongoDbException
- On an error finding the documents.public void explainAsync(LambdaCallback<Document> results, Aggregate.Builder aggregation) throws MongoDbException
Overridden to call the explainAsync(Callback, Aggregate.Builder)
method with an adapter for the LambdaCallback
.
explainAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the explain.aggregation
- The aggregation details.MongoDbException
- On an error finding the documents.public void explainAsync(LambdaCallback<Document> results, Find query) throws MongoDbException
Overridden to call the AbstractMongoOperations.explainAsync(Callback, Find)
method with
an adapter for the LambdaCallback
.
explainAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the explain.query
- The query details.MongoDbException
- On an error finding the documents.public void explainAsync(LambdaCallback<Document> results, Find.Builder query) throws MongoDbException
Overridden to call the explainAsync(Callback, Find.Builder)
method with an adapter for the LambdaCallback
.
explainAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the explain.query
- The query details.MongoDbException
- On an error finding the documents.public void findAndModifyAsync(Callback<Document> results, FindAndModify.Builder command) throws MongoDbException
Overridden to call the
AbstractMongoOperations.findAndModifyAsync(Callback,FindAndModify)
.
findAndModifyAsync
in interface AsyncMongoCollection
results
- Callback for the the found document.command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.public ListenableFuture<Document> findAndModifyAsync(FindAndModify command) throws MongoDbException
Overridden to call the
AbstractMongoOperations.findAndModifyAsync(Callback, FindAndModify)
.
findAndModifyAsync
in interface AsyncMongoCollection
command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.AbstractMongoOperations.findAndModifyAsync(Callback, FindAndModify)
public ListenableFuture<Document> findAndModifyAsync(FindAndModify.Builder command) throws MongoDbException
Overridden to call the findAndModifyAsync(FindAndModify)
.
findAndModifyAsync
in interface AsyncMongoCollection
command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.public void findAndModifyAsync(LambdaCallback<Document> results, FindAndModify command) throws MongoDbException
Overridden to call the
AbstractMongoOperations.findAndModifyAsync(Callback, FindAndModify)
method with an
adapter for the LambdaCallback
.
findAndModifyAsync
in interface AsyncMongoCollection
results
- Callback for the the found document.command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.public void findAndModifyAsync(LambdaCallback<Document> results, FindAndModify.Builder command) throws MongoDbException
Overridden to call the
findAndModifyAsync(Callback, FindAndModify.Builder)
method with
an adapter for the LambdaCallback
.
findAndModifyAsync
in interface AsyncMongoCollection
results
- Callback for the the found document.command
- The details of the find and modify request.MongoDbException
- On an error finding the documents.public void findAsync(Callback<MongoIterator<Document>> results, DocumentAssignable query) throws MongoDbException
Overridden to call the AbstractMongoOperations.findAsync(Callback, Find)
.
findAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query document.MongoDbException
- On an error finding the documents.findAsync(Callback, DocumentAssignable)
public void findAsync(Callback<MongoIterator<Document>> results, Find.Builder query) throws MongoDbException
Overridden to call the AbstractMongoOperations.findAsync(Callback,Find)
method.
findAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the documents.public ListenableFuture<MongoIterator<Document>> findAsync(DocumentAssignable query) throws MongoDbException
Overridden to call the findAsync(Callback, DocumentAssignable)
.
findAsync
in interface AsyncMongoCollection
query
- The query document.MongoDbException
- On an error finding the documents.findAsync(Callback, DocumentAssignable)
public ListenableFuture<MongoIterator<Document>> findAsync(Find query) throws MongoDbException
Overridden to call the AbstractMongoOperations.findAsync(Callback, Find)
.
findAsync
in interface AsyncMongoCollection
query
- The query details.MongoDbException
- On an error finding the documents.AbstractMongoOperations.findAsync(Callback, Find)
public ListenableFuture<MongoIterator<Document>> findAsync(Find.Builder query) throws MongoDbException
Overridden to call the findAsync(Find)
method.
findAsync
in interface AsyncMongoCollection
query
- The query details.MongoDbException
- On an error finding the documents.public void findAsync(LambdaCallback<MongoIterator<Document>> results, DocumentAssignable query) throws MongoDbException
Overridden to call the findAsync(Callback, DocumentAssignable)
method with an adapter for the LambdaCallback
.
findAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query document.MongoDbException
- On an error finding the documents.public void findAsync(LambdaCallback<MongoIterator<Document>> results, Find query) throws MongoDbException
Overridden to call the AbstractMongoOperations.findAsync(Callback, Find)
method with an
adapter for the LambdaCallback
.
findAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the documents.public void findAsync(LambdaCallback<MongoIterator<Document>> results, Find.Builder query) throws MongoDbException
Overridden to call the findAsync(Callback, Find.Builder)
method
with an adapter for the LambdaCallback
.
findAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the documents.public void findOneAsync(Callback<Document> results, DocumentAssignable query) throws MongoDbException
Overridden to call the AbstractMongoOperations.findOneAsync(Callback, Find)
.
findOneAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query document.MongoDbException
- On an error finding the document.AbstractMongoOperations.findOneAsync(Callback, Find)
public 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.
Overridden to call the AbstractMongoOperations.findOneAsync(Callback, Find)
method.
findOneAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the document.public ListenableFuture<Document> findOneAsync(DocumentAssignable query) throws MongoDbException
Overridden to call the
findOneAsync(Callback, DocumentAssignable)
.
findOneAsync
in interface AsyncMongoCollection
query
- The query document.MongoDbException
- On an error finding the document.findOneAsync(Callback, DocumentAssignable)
public 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.
Overridden to call the AbstractMongoOperations.findOneAsync(Callback, Find)
.
findOneAsync
in interface AsyncMongoCollection
query
- The query details.MongoDbException
- On an error finding the document.AbstractMongoOperations.findOneAsync(Callback, Find)
public 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.
Overridden to call the findOneAsync(Find)
method.
findOneAsync
in interface AsyncMongoCollection
query
- The query details.MongoDbException
- On an error finding the document.public void findOneAsync(LambdaCallback<Document> results, DocumentAssignable query) throws MongoDbException
Overridden to call the findAsync(Callback, DocumentAssignable)
method with an adapter for the LambdaCallback
.
findOneAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query document.MongoDbException
- On an error finding the document.public 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.
Overridden to call the AbstractMongoOperations.findAsync(Callback, Find)
method with an
adapter for the LambdaCallback
.
findOneAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the document.public 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.
Overridden to call the findAsync(Callback, Find.Builder)
method
with an adapter for the LambdaCallback
.
findOneAsync
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.query
- The query details.MongoDbException
- On an error finding the document.public void groupByAsync(Callback<MongoIterator<Element>> results, GroupBy.Builder command) throws MongoDbException
Overridden to call the AbstractMongoOperations.groupByAsync(Callback,GroupBy)
.
groupByAsync
in interface AsyncMongoCollection
results
- Callback for the group results returned.command
- The details of the group request.MongoDbException
- On an error finding the documents.public ListenableFuture<MongoIterator<Element>> groupByAsync(GroupBy command) throws MongoDbException
Overridden to call the AbstractMongoOperations.groupByAsync(Callback, GroupBy)
.
groupByAsync
in interface AsyncMongoCollection
command
- The details of the group request.MongoDbException
- On an error finding the documents.public ListenableFuture<MongoIterator<Element>> groupByAsync(GroupBy.Builder command) throws MongoDbException
Overridden to call the groupByAsync(GroupBy)
.
groupByAsync
in interface AsyncMongoCollection
command
- The details of the group request.MongoDbException
- On an error finding the documents.public void groupByAsync(LambdaCallback<MongoIterator<Element>> results, GroupBy command) throws MongoDbException
Overridden to call the AbstractMongoOperations.groupByAsync(Callback, GroupBy)
method
with an adapter for the LambdaCallback
.
groupByAsync
in interface AsyncMongoCollection
results
- Callback for the group results returned.command
- The details of the group request.MongoDbException
- On an error finding the documents.public void groupByAsync(LambdaCallback<MongoIterator<Element>> results, GroupBy.Builder command) throws MongoDbException
Overridden to call the groupByAsync(Callback, GroupBy.Builder)
method with an adapter for the LambdaCallback
.
groupByAsync
in interface AsyncMongoCollection
results
- Callback for the group results returned.command
- The details of the group request.MongoDbException
- On an error finding the documents.public ListenableFuture<Integer> insertAsync(boolean continueOnError, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
AbstractMongoOperations.insertAsync(Callback, boolean, Durability, DocumentAssignable...)
method with the default durability
.
insertAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.insertAsync(Callback, boolean, Durability,
DocumentAssignable[])
public ListenableFuture<Integer> insertAsync(boolean continueOnError, Durability durability, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
AbstractMongoOperations.insertAsync(Callback, boolean, Durability, DocumentAssignable...)
method with continueOnError set to false and the
default durability
.
insertAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.insertAsync(Callback, boolean, Durability,
DocumentAssignable[])
public void insertAsync(Callback<Integer> results, boolean continueOnError, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
AbstractMongoOperations.insertAsync(Callback, boolean, Durability, DocumentAssignable...)
method the default durability
.
insertAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.insertAsync(Callback, boolean, Durability,
DocumentAssignable[])
public void insertAsync(Callback<Integer> results, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
AbstractMongoOperations.insertAsync(Callback, boolean, Durability, DocumentAssignable...)
method with continueOnError set to false and the
default durability
.
insertAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.insertAsync(Callback, boolean, Durability,
DocumentAssignable[])
public void insertAsync(Callback<Integer> results, Durability durability, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
AbstractMongoOperations.insertAsync(Callback, boolean, Durability, DocumentAssignable...)
method with continueOnError set to false.
insertAsync
in interface AsyncMongoCollection
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.AsyncMongoCollection.insertAsync(Callback, boolean, Durability,
DocumentAssignable[])
public ListenableFuture<Integer> insertAsync(DocumentAssignable... documents) throws MongoDbException
Overridden to call the
AbstractMongoOperations.insertAsync(Callback, boolean, Durability, DocumentAssignable...)
method with continueOnError set to false and the
default durability
.
insertAsync
in interface AsyncMongoCollection
documents
- The documents to add to the collection.-1
.MongoDbException
- On an error inserting the documents.AsyncMongoCollection.insertAsync(Callback, boolean, Durability,
DocumentAssignable[])
public ListenableFuture<Integer> insertAsync(Durability durability, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
AbstractMongoOperations.insertAsync(Callback, boolean, Durability, DocumentAssignable...)
method with continueOnError set to false.
insertAsync
in interface AsyncMongoCollection
durability
- The durability for the insert.documents
- The documents to add to the collection.-1
.MongoDbException
- On an error inserting the documents.AsyncMongoCollection.insertAsync(Callback, boolean, Durability,
DocumentAssignable[])
public void insertAsync(LambdaCallback<Integer> results, boolean continueOnError, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
insertAsync(Callback, boolean, DocumentAssignable[])
method with
an adapter for the LambdaCallback
.
insertAsync
in interface AsyncMongoCollection
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.public void insertAsync(LambdaCallback<Integer> results, boolean continueOnError, Durability durability, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
AbstractMongoOperations.insertAsync(Callback, boolean, Durability, DocumentAssignable[])
method with an adapter for the LambdaCallback
.
insertAsync
in interface AsyncMongoCollection
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.public void insertAsync(LambdaCallback<Integer> results, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
insertAsync(Callback, DocumentAssignable[])
method with an
adapter for the LambdaCallback
.
insertAsync
in interface AsyncMongoCollection
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.public void insertAsync(LambdaCallback<Integer> results, Durability durability, DocumentAssignable... documents) throws MongoDbException
Overridden to call the
insertAsync(Callback, Durability, DocumentAssignable[])
method
with an adapter for the LambdaCallback
.
insertAsync
in interface AsyncMongoCollection
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.public void mapReduceAsync(Callback<MongoIterator<Document>> results, MapReduce.Builder command) throws MongoDbException
Overridden to call the AbstractMongoOperations.mapReduceAsync(Callback,MapReduce)
.
mapReduceAsync
in interface AsyncMongoCollection
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.public void mapReduceAsync(LambdaCallback<MongoIterator<Document>> results, MapReduce command) throws MongoDbException
Overridden to call the AbstractMongoOperations.mapReduceAsync(Callback, MapReduce)
method with an adapter for the LambdaCallback
.
mapReduceAsync
in interface AsyncMongoCollection
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.public void mapReduceAsync(LambdaCallback<MongoIterator<Document>> results, MapReduce.Builder command) throws MongoDbException
Overridden to call the
mapReduceAsync(Callback, MapReduce.Builder)
method with an
adapter for the LambdaCallback
.
mapReduceAsync
in interface AsyncMongoCollection
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.public ListenableFuture<MongoIterator<Document>> mapReduceAsync(MapReduce command) throws MongoDbException
Overridden to call the AbstractMongoOperations.mapReduceAsync(Callback, MapReduce)
.
mapReduceAsync
in interface AsyncMongoCollection
command
- The details of the map/reduce request.MongoDbException
- On an error finding the documents.AbstractMongoOperations.mapReduceAsync(Callback, MapReduce)
public ListenableFuture<MongoIterator<Document>> mapReduceAsync(MapReduce.Builder command) throws MongoDbException
Overridden to call the mapReduceAsync(MapReduce)
.
mapReduceAsync
in interface AsyncMongoCollection
command
- The details of the map/reduce request.MongoDbException
- On an error finding the documents.public 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.
Overridden to call the AbstractMongoOperations.parallelScanAsync(Callback, ParallelScan)
.
parallelScanAsync
in interface AsyncMongoCollection
results
- Callback for the collection of iterators.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.public 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.
Overridden to call the AbstractMongoOperations.parallelScanAsync(Callback, ParallelScan)
method with an adapter for the LambdaCallback
.
parallelScanAsync
in interface AsyncMongoCollection
results
- Callback for the collection of iterators.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.public 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.
Overridden to call the
parallelScanAsync(LambdaCallback, ParallelScan)
method.
parallelScanAsync
in interface AsyncMongoCollection
results
- Callback for the collection of iterators.parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.public 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.
Overridden to call the AbstractMongoOperations.parallelScanAsync(Callback, ParallelScan)
.
parallelScanAsync
in interface AsyncMongoCollection
parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.public 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.
Overridden to call the AbstractMongoOperations.parallelScanAsync(Callback, ParallelScan)
.
parallelScanAsync
in interface AsyncMongoCollection
parallelScan
- The details on the scan.MongoDbException
- On an error initializing the parallel scan.public 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)
.
Overridden to call the
AbstractMongoOperations.saveAsync(Callback, DocumentAssignable, Durability)
using the
default durability
.
saveAsync
in interface AsyncMongoCollection
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.public 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)
.
Overridden to call the
AbstractMongoOperations.saveAsync(Callback, DocumentAssignable, Durability)
using the
default durability
.
saveAsync
in interface AsyncMongoCollection
document
- The document to save to the collection.MongoDbException
- On an error saving the documents.public 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)
.
Overridden to call the
AbstractMongoOperations.saveAsync(Callback, DocumentAssignable, Durability)
.
saveAsync
in interface AsyncMongoCollection
document
- The document to save to the collection.durability
- The durability for the save.MongoDbException
- On an error saving the documents.public 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)
.
Overridden to call the saveAsync(Callback, DocumentAssignable)
method with an adapter for the LambdaCallback
.
saveAsync
in interface AsyncMongoCollection
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.public 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)
.
Overridden to call the
AbstractMongoOperations.saveAsync(Callback, DocumentAssignable, Durability)
method with
an adapter for the LambdaCallback
.
saveAsync
in interface AsyncMongoCollection
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.public 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.
Overridden to call the AbstractMongoOperations.stream(StreamCallback, Aggregate)
method
with an adapter for the LambdaCallback
.
stream
in interface AsyncMongoCollection
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.public 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() )
.
Overridden to call the stream(StreamCallback, Aggregate.Builder)
method with an adapter for the LambdaCallback
.
stream
in interface AsyncMongoCollection
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.public 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.
Overridden to call the AbstractMongoOperations.stream(StreamCallback, Find)
method with
an adapter for the LambdaCallback
.
stream
in interface AsyncMongoCollection
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.public MongoCursorControl stream(LambdaCallback<Document> results, Find.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.
Overridden to call the stream(StreamCallback, Find.Builder)
method with an adapter for the LambdaCallback
.
stream
in interface AsyncMongoCollection
results
- Callback that will be notified of the results of the query.aggregation
- 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.public 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() )
.
Overridden to call the AbstractMongoOperations.stream(StreamCallback, Aggregate)
.
stream
in interface AsyncMongoCollection
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.AbstractMongoOperations.stream(StreamCallback, Aggregate)
public 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.
Overridden to call the AbstractMongoOperations.stream(StreamCallback, Find)
method.
stream
in interface AsyncMongoCollection
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 public MongoCursorControl streamingFind(Callback<Document> results, DocumentAssignable query) throws MongoDbException
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.
Overridden to call the streamingFind(Callback, Find)
.
streamingFind
in interface AsyncMongoCollection
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.streamingFind(Callback, Find)
@Deprecated public MongoCursorControl streamingFind(Callback<Document> results, Find query) throws MongoDbException
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.
Overridden to call the AbstractMongoOperations.stream(StreamCallback, Find)
.
streamingFind
in interface AsyncMongoCollection
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.AbstractMongoOperations.stream(StreamCallback, Find)
public 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.
Overridden to call the
streamingFind(StreamCallback, DocumentAssignable)
method with an
adapter for the LambdaCallback
.
streamingFind
in interface AsyncMongoCollection
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.public 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.
Overridden to call the AbstractMongoOperations.stream(StreamCallback, Find)
.
streamingFind
in interface AsyncMongoCollection
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.AbstractMongoOperations.stream(StreamCallback, Find)
@Deprecated public MongoCursorControl streamingFind(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.
Overridden to call the streamingFind(StreamCallback, Find)
.
streamingFind
in interface AsyncMongoCollection
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.AbstractMongoOperations.stream(StreamCallback, Find)
@Deprecated public MongoCursorControl streamingFind(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.
Overridden to call the streamingFind(StreamCallback, Find)
method.
streamingFind
in interface AsyncMongoCollection
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 public 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.
Overridden to call the
AbstractMongoOperations.textSearchAsync(Callback, com.allanbank.mongodb.builder.Text)
.
textSearchAsync
in interface AsyncMongoCollection
results
- Callback for the text
results returned.command
- The details of the text
request.MongoDbException
- On an error executing the text
command.@Deprecated public 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.
Overridden to call the
AbstractMongoOperations.textSearchAsync(Callback, com.allanbank.mongodb.builder.Text)
.
textSearchAsync
in interface AsyncMongoCollection
command
- The details of the text
request.text
results returned.MongoDbException
- On an error executing the text
command.AbstractMongoOperations.textSearchAsync(Callback, com.allanbank.mongodb.builder.Text)
@Deprecated public 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.
Overridden to call the
textSearchAsync(com.allanbank.mongodb.builder.Text)
.
textSearchAsync
in interface AsyncMongoCollection
command
- The details of the text
request.text
results returned.MongoDbException
- On an error executing the text
command.public void updateAsync(Callback<Long> results, DocumentAssignable query, DocumentAssignable update) throws MongoDbException
Overridden to call the
AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean, Durability)
with multiUpdate set to true, upsert set to false, and using the
default durability
.
updateAsync
in interface AsyncMongoCollection
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.AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable,
boolean, boolean, Durability)
public void updateAsync(Callback<Long> results, DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert) throws MongoDbException
Overridden to call the
AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean, Durability)
using the default durability
.
updateAsync
in interface AsyncMongoCollection
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.AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable,
boolean, boolean, Durability)
public void updateAsync(Callback<Long> results, DocumentAssignable query, DocumentAssignable update, Durability durability) throws MongoDbException
Overridden to call the
AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean, Durability)
with multiUpdate set to true, and upsert set to false.
updateAsync
in interface AsyncMongoCollection
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.AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable,
boolean, boolean, Durability)
public ListenableFuture<Long> updateAsync(DocumentAssignable query, DocumentAssignable update) throws MongoDbException
Overridden to call the
AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean, Durability)
with multiUpdate set to true, upsert set to false, and using the
default durability
.
updateAsync
in interface AsyncMongoCollection
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.AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable,
boolean, boolean, Durability)
public ListenableFuture<Long> updateAsync(DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert) throws MongoDbException
Overridden to call the
AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean, Durability)
using the default durability
.
updateAsync
in interface AsyncMongoCollection
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.AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable,
boolean, boolean, Durability)
public ListenableFuture<Long> updateAsync(DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert, Durability durability) throws MongoDbException
Overridden to call the
AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean, Durability)
method.
updateAsync
in interface AsyncMongoCollection
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.AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable,
boolean, boolean, Durability)
public ListenableFuture<Long> updateAsync(DocumentAssignable query, DocumentAssignable update, Durability durability) throws MongoDbException
Overridden to call the
AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean, Durability)
with multiUpdate set to true, and upsert set to false.
updateAsync
in interface AsyncMongoCollection
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.AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable,
boolean, boolean, Durability)
public void updateAsync(LambdaCallback<Long> results, DocumentAssignable query, DocumentAssignable update) throws MongoDbException
Overridden to call the
updateAsync(Callback, DocumentAssignable, DocumentAssignable)
method with an adapter for the LambdaCallback
.
updateAsync
in interface AsyncMongoCollection
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.public void updateAsync(LambdaCallback<Long> results, DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert) throws MongoDbException
Overridden to call the
updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean)
method with an adapter for the LambdaCallback
.
updateAsync
in interface AsyncMongoCollection
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.public void updateAsync(LambdaCallback<Long> results, DocumentAssignable query, DocumentAssignable update, boolean multiUpdate, boolean upsert, Durability durability) throws MongoDbException
Overridden to call the
AbstractMongoOperations.updateAsync(Callback, DocumentAssignable, DocumentAssignable, boolean, boolean, Durability)
method with an adapter for the LambdaCallback
.
updateAsync
in interface AsyncMongoCollection
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.public void updateAsync(LambdaCallback<Long> results, DocumentAssignable query, DocumentAssignable update, Durability durability) throws MongoDbException
Overridden to call the
updateAsync(Callback, DocumentAssignable, DocumentAssignable, Durability)
method with an adapter for the LambdaCallback
.
updateAsync
in interface AsyncMongoCollection
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.public 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
.
Overridden to call the AbstractMongoOperations.writeAsync(Callback, BatchedWrite)
method.
writeAsync
in interface AsyncMongoCollection
write
- The batched writesreturn
for
the AsyncMongoCollection.insertAsync(DocumentAssignable...)
method applies.MongoDbException
- On an error submitting the write operations.AbstractMongoOperations.writeAsync(Callback, BatchedWrite)
public 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
.
Overridden to call the writeAsync(BatchedWrite)
method.
writeAsync
in interface AsyncMongoCollection
write
- The batched writesreturn
for
the AsyncMongoCollection.insertAsync(DocumentAssignable...)
method applies.MongoDbException
- On an error submitting the write operations.writeAsync(BatchedWrite)
public 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
.
Overridden to call the AbstractMongoOperations.writeAsync(Callback, BatchedWrite)
method.
writeAsync
in interface AsyncMongoCollection
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
AsyncMongoCollection.insertAsync(Callback, DocumentAssignable...)
method
applies.write
- The batched writesMongoDbException
- On an error submitting the write operations.AbstractMongoOperations.writeAsync(Callback, BatchedWrite)
public 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
.
Overridden to call the AbstractMongoOperations.writeAsync(Callback, BatchedWrite)
method.
writeAsync
in interface AsyncMongoCollection
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
AsyncMongoCollection.insertAsync(Callback, DocumentAssignable...)
method
applies.write
- The batched writesMongoDbException
- On an error submitting the write operations.AbstractMongoOperations.writeAsync(Callback, BatchedWrite)
public 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
.
Overridden to call the writeAsync(LambdaCallback, BatchedWrite)
method.
writeAsync
in interface AsyncMongoCollection
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
AsyncMongoCollection.insertAsync(Callback, DocumentAssignable...)
method
applies.write
- The batched writesMongoDbException
- On an error submitting the write operations.writeAsync(LambdaCallback, BatchedWrite)
protected LockType getLockType()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.