TResult
- The type of the result.public interface ChangeStreamPublisher<TResult> extends org.reactivestreams.Publisher<ChangeStreamDocument<TResult>>
Modifier and Type | Method and Description |
---|---|
ChangeStreamPublisher<TResult> |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
ChangeStreamPublisher<TResult> |
collation(Collation collation)
Sets the collation options
|
org.reactivestreams.Publisher<ChangeStreamDocument<TResult>> |
first()
Helper to return a publisher limited to the first result.
|
ChangeStreamPublisher<TResult> |
fullDocument(FullDocument fullDocument)
Sets the fullDocument value.
|
ChangeStreamPublisher<TResult> |
maxAwaitTime(long maxAwaitTime,
TimeUnit timeUnit)
Sets the maximum await execution time on the server for this operation.
|
ChangeStreamPublisher<TResult> |
resumeAfter(BsonDocument resumeToken)
Sets the logical starting point for the new change stream.
|
ChangeStreamPublisher<TResult> |
startAtOperationTime(BsonTimestamp startAtOperationTime)
The change stream will only provide changes that occurred after the specified timestamp.
|
<TDocument> |
withDocumentClass(Class<TDocument> clazz)
Returns a
MongoIterable containing the results of the change stream based on the document class provided. |
ChangeStreamPublisher<TResult> fullDocument(FullDocument fullDocument)
fullDocument
- the fullDocumentChangeStreamPublisher<TResult> resumeAfter(BsonDocument resumeToken)
resumeToken
- the resume tokenChangeStreamPublisher<TResult> 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 timeChangeStreamPublisher<TResult> maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
maxAwaitTime
- the max await time. A zero value will be ignored, and indicates that the driver should respect the server's
default valuetimeUnit
- the time unit, which may not be nullChangeStreamPublisher<TResult> collation(Collation collation)
A null value represents the server default.
collation
- the collation options to use<TDocument> org.reactivestreams.Publisher<TDocument> withDocumentClass(Class<TDocument> clazz)
MongoIterable
containing the results of the change stream based on the document class provided.TDocument
- the result typeclazz
- the class to use for the raw result.ChangeStreamPublisher<TResult> batchSize(int batchSize)
Overrides the Subscription.request(long)
value for setting the batch size, allowing for fine grained
control over the underlying cursor.
batchSize
- the batch sizeorg.reactivestreams.Publisher<ChangeStreamDocument<TResult>> first()