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.
|
ChangeStreamOperation(MongoNamespace namespace,
FullDocument fullDocument,
java.util.List<BsonDocument> pipeline,
Decoder<T> decoder,
ChangeStreamLevel changeStreamLevel)
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.
|
BsonDocument |
getResumeToken()
Returns the logical starting point for the new change stream.
|
BsonTimestamp |
getStartAtOperationTime()
Returns the start at operation time
|
ChangeStreamOperation<T> |
maxAwaitTime(long maxAwaitTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum await execution time on the server for this operation.
|
ChangeStreamOperation<T> |
resumeAfter(BsonDocument resumeToken)
Sets the logical starting point for the new change stream.
|
ChangeStreamOperation<T> |
startAtOperationTime(BsonTimestamp startAtOperationTime)
The change stream will only provides changes that occurred after the specified timestamp.
|
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 ChangeStreamOperation(MongoNamespace namespace, FullDocument fullDocument, java.util.List<BsonDocument> pipeline, Decoder<T> decoder, ChangeStreamLevel changeStreamLevel)
namespace
- the database and collection namespace for the operation.fullDocument
- the fullDocument valuepipeline
- the aggregation pipeline.decoder
- the decoder for the result documents.changeStreamLevel
- the level at which the change stream is observingpublic 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 Collation getCollation()
public ChangeStreamOperation<T> collation(Collation collation)
A null value represents the server default.
collation
- the collation options to usepublic ChangeStreamOperation<T> startAtOperationTime(BsonTimestamp startAtOperationTime)
Any command run against the server will return an operation time that can be used here.
The default value is an operation time obtained from the server before the change stream was created.
startAtOperationTime
- the start at operation timepublic BsonTimestamp getStartAtOperationTime()
public BatchCursor<T> execute(ReadBinding binding)
ReadOperation
execute
in interface ReadOperation<BatchCursor<T>>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback)
AsyncReadOperation
executeAsync
in interface AsyncReadOperation<AsyncBatchCursor<T>>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executedCopyright © 2010 - 2020 Adobe. All Rights Reserved