Class ChangeStreamOptions.ChangeStreamOptionsBuilder
java.lang.Object
org.springframework.data.mongodb.core.ChangeStreamOptions.ChangeStreamOptionsBuilder
- Enclosing class:
- ChangeStreamOptions
Builder for creating
ChangeStreamOptions
.- Since:
- 2.1
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Set the collation to use.filter
(org.bson.Document... filter) Set the plain filter chain to apply.filter
(Aggregation filter) Set the filter to apply.fullDocumentBeforeChangeLookup
(com.mongodb.client.model.changestream.FullDocumentBeforeChange lookup) Set theFullDocumentBeforeChange
lookup to use.fullDocumentLookup
(com.mongodb.client.model.changestream.FullDocument lookup) Set theFullDocument
lookup to use.resumeAfter
(org.bson.BsonValue resumeToken) Set the resume token after which to continue emitting notifications.Set the cluster time to resume from.resumeAt
(org.bson.BsonTimestamp resumeTimestamp) Set the cluster time to resume from.resumeToken
(org.bson.BsonValue resumeToken) Set the resume token (typically aBsonDocument
containing abinary token
) after which to start with listening.Return the full document before being changed if it is available.Set theFullDocument
lookup toFullDocument.UPDATE_LOOKUP
.startAfter
(org.bson.BsonValue resumeToken) Set the resume token after which to start emitting notifications.
-
Method Details
-
collation
Set the collation to use.- Parameters:
collation
- must not be null nor empty.- Returns:
- this.
-
filter
Set the filter to apply.
Fields on aggregation expression root level are prefixed to map to fields contained infullDocument
. However operationType, ns, documentKey and fullDocument are reserved words that will be omitted, and therefore taken as given, during the mapping procedure. You may want to have a look at the structure of Change Events.
UseTypedAggregation
to ensure filter expressions are mapped to domain type fields.- Parameters:
filter
- theAggregation pipeline
to apply for filtering events. Must not be null.- Returns:
- this.
-
filter
Set the plain filter chain to apply.- Parameters:
filter
- must not be null nor contain null values.- Returns:
- this.
-
resumeToken
Set the resume token (typically aBsonDocument
containing abinary token
) after which to start with listening.- Parameters:
resumeToken
- must not be null.- Returns:
- this.
-
returnFullDocumentOnUpdate
Set theFullDocument
lookup toFullDocument.UPDATE_LOOKUP
.- Returns:
- this.
- See Also:
-
fullDocumentLookup
public ChangeStreamOptions.ChangeStreamOptionsBuilder fullDocumentLookup(com.mongodb.client.model.changestream.FullDocument lookup) Set theFullDocument
lookup to use.- Parameters:
lookup
- must not be null.- Returns:
- this.
-
fullDocumentBeforeChangeLookup
public ChangeStreamOptions.ChangeStreamOptionsBuilder fullDocumentBeforeChangeLookup(com.mongodb.client.model.changestream.FullDocumentBeforeChange lookup) Set theFullDocumentBeforeChange
lookup to use.- Parameters:
lookup
- must not be null.- Returns:
- this.
- Since:
- 4.0
-
returnFullDocumentBeforeChange
Return the full document before being changed if it is available.- Returns:
- this.
- Since:
- 4.0
- See Also:
-
resumeAt
Set the cluster time to resume from.- Parameters:
resumeTimestamp
- must not be null.- Returns:
- this.
-
resumeAt
public ChangeStreamOptions.ChangeStreamOptionsBuilder resumeAt(org.bson.BsonTimestamp resumeTimestamp) Set the cluster time to resume from.- Parameters:
resumeTimestamp
- must not be null.- Returns:
- this.
- Since:
- 2.2
-
resumeAfter
Set the resume token after which to continue emitting notifications.- Parameters:
resumeToken
- must not be null.- Returns:
- this.
- Since:
- 2.2
-
startAfter
Set the resume token after which to start emitting notifications.- Parameters:
resumeToken
- must not be null.- Returns:
- this.
- Since:
- 2.2
-
build
- Returns:
- the built
ChangeStreamOptions
-