T - the operations result type.public class ChangeStreamOperation<T> extends java.lang.Object implements AsyncReadOperation<AsyncBatchCursor<T>>, ReadOperation<BatchCursor<T>>
$changeStream aggregation.| Constructor and Description |
|---|
ChangeStreamOperation(MongoNamespace namespace,
FullDocument fullDocument,
java.util.List<BsonDocument> pipeline,
Decoder<T> decoder)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ChangeStreamOperation<T> |
batchSize(java.lang.Integer batchSize)
Sets the number of documents to return per batch.
|
ChangeStreamOperation<T> |
collation(Collation collation)
Sets the collation options
|
BatchCursor<T> |
execute(ReadBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback)
General execute which can return anything of type T
|
java.lang.Integer |
getBatchSize()
Gets the number of documents to return per batch.
|
Collation |
getCollation()
Returns the collation options
|
Decoder<T> |
getDecoder() |
FullDocument |
getFullDocument()
Returns the fullDocument value, in 3.6
|
long |
getMaxAwaitTime(java.util.concurrent.TimeUnit timeUnit)
The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor
query.
|
MongoNamespace |
getNamespace() |
java.util.List<BsonDocument> |
getPipeline()
Gets the aggregation pipeline.
|
ReadConcern |
getReadConcern()
Gets the read concern
|
BsonDocument |
getResumeToken()
Returns the logical starting point for the new change stream.
|
ChangeStreamOperation<T> |
maxAwaitTime(long maxAwaitTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum await execution time on the server for this operation.
|
ChangeStreamOperation<T> |
readConcern(ReadConcern readConcern)
Sets the read concern
|
ChangeStreamOperation<T> |
resumeAfter(BsonDocument resumeToken)
Sets the logical starting point for the new change stream.
|
public ChangeStreamOperation(MongoNamespace namespace, FullDocument fullDocument, java.util.List<BsonDocument> pipeline, Decoder<T> decoder)
namespace - the database and collection namespace for the operation.fullDocument - the fullDocument valuepipeline - the aggregation pipeline.decoder - the decoder for the result documents.public MongoNamespace getNamespace()
public FullDocument getFullDocument()
public BsonDocument getResumeToken()
A null value represents the server default.
public ChangeStreamOperation<T> resumeAfter(BsonDocument resumeToken)
resumeToken - the resumeTokenpublic java.util.List<BsonDocument> getPipeline()
public java.lang.Integer getBatchSize()
public ChangeStreamOperation<T> batchSize(java.lang.Integer batchSize)
batchSize - the batch sizepublic long getMaxAwaitTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit - the time unit to return the result inpublic ChangeStreamOperation<T> maxAwaitTime(long maxAwaitTime, java.util.concurrent.TimeUnit timeUnit)
maxAwaitTime - the max await time. A value less than one will be ignored, and indicates that the driver should respect the
server's default valuetimeUnit - the time unit, which may not be nullpublic ReadConcern getReadConcern()
public ChangeStreamOperation<T> readConcern(ReadConcern readConcern)
readConcern - the read concernpublic Collation getCollation()
public ChangeStreamOperation<T> collation(Collation collation)
A null value represents the server default.
collation - the collation options to usepublic BatchCursor<T> execute(ReadBinding binding)
ReadOperationexecute in interface ReadOperation<BatchCursor<T>>binding - the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback)
AsyncReadOperationexecuteAsync in interface AsyncReadOperation<AsyncBatchCursor<T>>binding - the binding to execute in the context ofcallback - the callback to be called when the operation has been executed