Class ChangeStreamOptions

java.lang.Object
io.quarkus.mongodb.ChangeStreamOptions

public class ChangeStreamOptions extends Object
Configures the Change Stream
  • Constructor Details

    • ChangeStreamOptions

      public ChangeStreamOptions()
  • Method Details

    • fullDocument

      public ChangeStreamOptions fullDocument(com.mongodb.client.model.changestream.FullDocument fullDocument)
      Sets the fullDocument value.
      Parameters:
      fullDocument - the fullDocument
      Returns:
      this
    • fullDocumentBeforeChange

      public ChangeStreamOptions fullDocumentBeforeChange(com.mongodb.client.model.changestream.FullDocumentBeforeChange fullDocumentBeforeChange)
      Sets the fullDocumentBeforeChange value.
      Parameters:
      fullDocumentBeforeChange - the fullDocumentBeforeChange
      Returns:
      this
    • resumeAfter

      public ChangeStreamOptions resumeAfter(org.bson.BsonDocument resumeToken)
      Sets the logical starting point for the new change stream.
      Parameters:
      resumeToken - the resume token
      Returns:
      this
    • startAfter

      public ChangeStreamOptions startAfter(org.bson.BsonDocument resumeToken)
      Sets the logical starting point for the new change stream. Unlike resumeAfter, startAfter can resume notifications after an invalidate event by creating a new change stream.
      Parameters:
      resumeToken - the resume token
      Returns:
      this
    • startAtOperationTime

      public ChangeStreamOptions startAtOperationTime(org.bson.BsonTimestamp 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.
    • maxAwaitTime

      public ChangeStreamOptions maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
      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 default value
      timeUnit - the time unit, which may not be null
      Returns:
      this
    • collation

      public ChangeStreamOptions collation(com.mongodb.client.model.Collation collation)
      Sets the collation options

      A null value represents the server default.

      Parameters:
      collation - the collation options to use
      Returns:
      this
    • apply

      public <T> com.mongodb.reactivestreams.client.ChangeStreamPublisher<T> apply(com.mongodb.reactivestreams.client.ChangeStreamPublisher<T> stream)