Package io.vertx.mongo.client
Class ChangeStreamOptions
- java.lang.Object
-
- io.vertx.mongo.client.ChangeStreamOptions
-
public class ChangeStreamOptions extends java.lang.Object
Options for change streams.- Since:
- 1.6
- Since server release
- 3.6
-
-
Constructor Summary
Constructors Constructor Description ChangeStreamOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
getBatchSize()
Collation
getCollation()
FullDocument
getFullDocument()
java.lang.Long
getMaxAwaitTime()
JsonObject
getResumeAfter()
JsonObject
getStartAfter()
java.lang.Long
getStartAtOperationTime()
ChangeStreamOptions
setBatchSize(java.lang.Integer batchSize)
Sets the number of documents to return per batch.ChangeStreamOptions
setCollation(Collation collation)
Sets the collation optionsChangeStreamOptions
setFullDocument(FullDocument fullDocument)
Sets the fullDocument value.ChangeStreamOptions
setMaxAwaitTime(java.lang.Long maxAwaitTime)
Sets the maximum await execution time on the server for this operation.ChangeStreamOptions
setResumeAfter(JsonObject resumeToken)
Sets the logical starting point for the new change stream.ChangeStreamOptions
setStartAfter(JsonObject startAfter)
Similar toresumeAfter
, this option takes a resume token and starts a new change stream returning the first notification after the token.ChangeStreamOptions
setStartAtOperationTime(java.lang.Long startAtOperationTime)
The change stream will only provide changes that occurred after the specified timestamp.
-
-
-
Method Detail
-
setFullDocument
public ChangeStreamOptions setFullDocument(FullDocument fullDocument)
Sets the fullDocument value.- Parameters:
fullDocument
- the fullDocument- Returns:
- this
-
getFullDocument
public FullDocument getFullDocument()
-
setResumeAfter
public ChangeStreamOptions setResumeAfter(JsonObject resumeToken)
Sets the logical starting point for the new change stream.- Parameters:
resumeToken
- the resume token- Returns:
- this
-
getResumeAfter
public JsonObject getResumeAfter()
-
setStartAtOperationTime
public ChangeStreamOptions setStartAtOperationTime(java.lang.Long startAtOperationTime)
The change stream will only provide 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:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- reference/method/db.runCommand/
-
getStartAtOperationTime
public java.lang.Long getStartAtOperationTime()
-
setStartAfter
public ChangeStreamOptions setStartAfter(JsonObject startAfter)
Similar toresumeAfter
, this option takes a resume token and starts a new change stream returning the first notification after the token.This will allow users to watch collections that have been dropped and recreated or newly renamed collections without missing any notifications.
Note: The server will report an error if both
startAfter
andresumeAfter
are specified.- Parameters:
startAfter
- the startAfter resumeToken- Returns:
- this
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- changeStreams/#change-stream-start-after
-
getStartAfter
public JsonObject getStartAfter()
-
setMaxAwaitTime
public ChangeStreamOptions setMaxAwaitTime(java.lang.Long maxAwaitTime)
Sets the maximum await execution time on the server for this operation.- Parameters:
maxAwaitTime
- the max await time. A zero value will be ignored, and indicates that the driver should respect the server's (in milliseconds) default value- Returns:
- this
-
getMaxAwaitTime
public java.lang.Long getMaxAwaitTime()
-
setCollation
public ChangeStreamOptions setCollation(Collation collation)
Sets the collation optionsA null value represents the server default.
- Parameters:
collation
- the collation options to use- Returns:
- this
-
getCollation
public Collation getCollation()
-
setBatchSize
public ChangeStreamOptions setBatchSize(java.lang.Integer batchSize)
Sets the number of documents to return per batch.Overrides the
Subscription.request(long)
value for setting the batch size, allowing for fine grained control over the underlying cursor.- Parameters:
batchSize
- the batch size- Returns:
- this
- Since:
- 1.8
- MongoDB documentation
- Batch Size
-
getBatchSize
public java.lang.Integer getBatchSize()
-
-