Package dev.morphia.aggregation.stages
Class ChangeStream
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.ChangeStream
Returns a Change Stream cursor on a collection, a database, or an entire cluster. Must be used as the first stage in an aggregation
pipeline.
- Since:
- 2.3
-
Method Summary
Modifier and TypeMethodDescriptionallChangesForCluster
(Boolean allChangesForCluster) Sets whether the change stream should include all changes in the cluster.static ChangeStream
Returns a Change Stream cursor on a collection, a database, or an entire cluster.fullDocument
(FullDocument fullDocument) Specifies whether change notifications include a copy of the full document when modified by update operations.fullDocumentBeforeChange
(FullDocumentBeforeChange fullDocumentBeforeChange) Include the full document from before the change.resumeAfter
(Document resumeAfter) Specifies a resume token as the logical starting point for the change stream.startAfter
(Document startAfter) Specifies a resume token as the logical starting point for the change stream.startAtOperationTime
(LocalDateTime startAtOperationTime) Specifies a time as the logical starting point for the change stream.
-
Method Details
-
changeStream
Returns a Change Stream cursor on a collection, a database, or an entire cluster. Must be used as the first stage in an aggregation pipeline.- Returns:
- the new ChangeStream stage
- Since:
- 2.3
- MongoDB documentation
- Aggregration Pipeline Stage: $changeStream
-
allChangesForCluster
Sets whether the change stream should include all changes in the cluster. May only be opened on the admin database.- Parameters:
allChangesForCluster
- true to get all changes- Returns:
- this
-
fullDocument
Specifies whether change notifications include a copy of the full document when modified by update operations.- Parameters:
fullDocument
- the option to apply- Returns:
- this
-
fullDocumentBeforeChange
Include the full document from before the change.- Parameters:
fullDocumentBeforeChange
- the option to apply- Returns:
- this
-
resumeAfter
Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.- Parameters:
resumeAfter
- the token to resume after- Returns:
- this
-
startAfter
Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.- Parameters:
startAfter
- the token to start after- Returns:
- this
-
startAtOperationTime
Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.- Parameters:
startAtOperationTime
- the time to start after- Returns:
- this
-