Package com.mongodb.operation
Class ChangeStreamOperation<T>
- java.lang.Object
-
- com.mongodb.operation.ChangeStreamOperation<T>
-
- Type Parameters:
T
- the operations result type.
- All Implemented Interfaces:
AsyncReadOperation<AsyncBatchCursor<T>>
,ReadOperation<BatchCursor<T>>
Deprecated.
@Deprecated public class ChangeStreamOperation<T> extends Object implements AsyncReadOperation<AsyncBatchCursor<T>>, ReadOperation<BatchCursor<T>>
An operation that executes an$changeStream
aggregation.- Since:
- 3.6
- MongoDB documentation
- Aggregation
- Since server release
- 2.6
-
-
Constructor Summary
Constructors Constructor Description ChangeStreamOperation(MongoNamespace namespace, FullDocument fullDocument, List<BsonDocument> pipeline, Decoder<T> decoder)
Deprecated.Construct a new instance.ChangeStreamOperation(MongoNamespace namespace, FullDocument fullDocument, List<BsonDocument> pipeline, Decoder<T> decoder, ChangeStreamLevel changeStreamLevel)
Deprecated.Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ChangeStreamOperation<T>
batchSize(Integer batchSize)
Deprecated.Sets the number of documents to return per batch.ChangeStreamOperation<T>
collation(Collation collation)
Deprecated.Sets the collation optionsBatchCursor<T>
execute(ReadBinding binding)
Deprecated.General execute which can return anything of type Tvoid
executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback)
Deprecated.General execute which can return anything of type TInteger
getBatchSize()
Deprecated.Gets the number of documents to return per batch.Collation
getCollation()
Deprecated.Returns the collation optionsDecoder<T>
getDecoder()
Deprecated.FullDocument
getFullDocument()
Deprecated.Returns the fullDocument value, in 3.6long
getMaxAwaitTime(TimeUnit timeUnit)
Deprecated.The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.MongoNamespace
getNamespace()
Deprecated.List<BsonDocument>
getPipeline()
Deprecated.Gets the aggregation pipeline.BsonDocument
getResumeToken()
Deprecated.Returns the logical starting point for the new change stream.BsonTimestamp
getStartAtOperationTime()
Deprecated.Returns the start at operation timeChangeStreamOperation<T>
maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
Deprecated.Sets the maximum await execution time on the server for this operation.ChangeStreamOperation<T>
resumeAfter(BsonDocument resumeToken)
Deprecated.Sets the logical starting point for the new change stream.ChangeStreamOperation<T>
startAtOperationTime(BsonTimestamp startAtOperationTime)
Deprecated.The change stream will only provides changes that occurred after the specified timestamp.
-
-
-
Constructor Detail
-
ChangeStreamOperation
public ChangeStreamOperation(MongoNamespace namespace, FullDocument fullDocument, List<BsonDocument> pipeline, Decoder<T> decoder)
Deprecated.Construct a new instance.- Parameters:
namespace
- the database and collection namespace for the operation.fullDocument
- the fullDocument valuepipeline
- the aggregation pipeline.decoder
- the decoder for the result documents.
-
ChangeStreamOperation
public ChangeStreamOperation(MongoNamespace namespace, FullDocument fullDocument, List<BsonDocument> pipeline, Decoder<T> decoder, ChangeStreamLevel changeStreamLevel)
Deprecated.Construct a new instance.- Parameters:
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 observing- Since:
- 3.8
-
-
Method Detail
-
getNamespace
public MongoNamespace getNamespace()
Deprecated.- Returns:
- the namespace for this operation
-
getFullDocument
public FullDocument getFullDocument()
Deprecated.Returns the fullDocument value, in 3.6- Returns:
- the fullDocument value
-
getResumeToken
public BsonDocument getResumeToken()
Deprecated.Returns the logical starting point for the new change stream.A null value represents the server default.
- Returns:
- the resumeAfter
-
resumeAfter
public ChangeStreamOperation<T> resumeAfter(BsonDocument resumeToken)
Deprecated.Sets the logical starting point for the new change stream.- Parameters:
resumeToken
- the resumeToken- Returns:
- this
-
getPipeline
public List<BsonDocument> getPipeline()
Deprecated.Gets the aggregation pipeline.- Returns:
- the pipeline
- MongoDB documentation
- Aggregation Pipeline
-
getBatchSize
public Integer getBatchSize()
Deprecated.Gets the number of documents to return per batch. Default to 0, which indicates that the server chooses an appropriate batch size.- Returns:
- the batch size, which may be null
- MongoDB documentation
- Batch Size
-
batchSize
public ChangeStreamOperation<T> batchSize(Integer batchSize)
Deprecated.Sets the number of documents to return per batch.- Parameters:
batchSize
- the batch size- Returns:
- this
- MongoDB documentation
- Batch Size
-
getMaxAwaitTime
public long getMaxAwaitTime(TimeUnit timeUnit)
Deprecated.The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. This only applies to a TAILABLE_AWAIT cursor. When the cursor is not a TAILABLE_AWAIT cursor, this option is ignored. A zero value will be ignored.- Parameters:
timeUnit
- the time unit to return the result in- Returns:
- the maximum await execution time in the given time unit
- MongoDB documentation
- Max Time
-
maxAwaitTime
public ChangeStreamOperation<T> maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
Deprecated.Sets the maximum await execution time on the server for this operation.- Parameters:
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 null- Returns:
- this
-
getCollation
public Collation getCollation()
Deprecated.Returns the collation options- Returns:
- the collation options
- MongoDB documentation
- Aggregation
-
collation
public ChangeStreamOperation<T> collation(Collation collation)
Deprecated.Sets the collation optionsA null value represents the server default.
- Parameters:
collation
- the collation options to use- Returns:
- this
- MongoDB documentation
- Aggregation
-
startAtOperationTime
public ChangeStreamOperation<T> startAtOperationTime(BsonTimestamp startAtOperationTime)
Deprecated.The change stream will only provides changes that occurred after the specified timestamp.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.
- Parameters:
startAtOperationTime
- the start at operation time- Returns:
- this
- Since:
- 3.8
- MongoDB documentation
- reference/method/db.runCommand/
- Since server release
- 4.0
-
getStartAtOperationTime
public BsonTimestamp getStartAtOperationTime()
Deprecated.Returns the start at operation time- Returns:
- the start at operation time
- Since:
- 3.8
- Since server release
- 4.0
-
execute
public BatchCursor<T> execute(ReadBinding binding)
Deprecated.Description copied from interface:ReadOperation
General execute which can return anything of type T- Specified by:
execute
in interfaceReadOperation<T>
- Parameters:
binding
- the binding to execute in the context of- Returns:
- T, the result of the execution
-
executeAsync
public void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback)
Deprecated.Description copied from interface:AsyncReadOperation
General execute which can return anything of type T- Specified by:
executeAsync
in interfaceAsyncReadOperation<T>
- Parameters:
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed
-
-