Module spring.data.mongodb
Interface ReactiveChangeStreamOperation
- All Known Subinterfaces:
ReactiveFluentMongoOperations,ReactiveMongoOperations
- All Known Implementing Classes:
ReactiveMongoTemplate
public interface ReactiveChangeStreamOperation
ReactiveChangeStreamOperation allows creation and execution of reactive MongoDB
Change Stream operations in a fluent API style. The starting domainType is used for mapping a potentially given
TypedAggregation used for filtering. By default, the
originating domainType is also used for mapping back the result from the Document.
However, it is possible to define an different returnType via as.The collection to operate on is optional in which case call collection with the actual database are watched, use watchCollection to define a fixed collection.
changeStream(Jedi.class)
.watchCollection("star-wars")
.filter(where("operationType").is("insert"))
.resumeAt(Instant.now())
.listen();
- Since:
- 2.2
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCollection override (optional).static interfaceProvide a filter for limiting results (optional).static interfaceProvide some options.static interfaceReactiveChangeStreamOperation.ReactiveChangeStreamprovides methods for constructing change stream operations in a fluent way.static interfaceResume a change stream.static interfaceCompose change stream execution by calling one of the terminating methods. -
Method Summary
Modifier and TypeMethodDescriptionchangeStream(Class<T> domainType) Start creating a change stream operation for the given domainType watching all collections within the database.
-
Method Details
-
changeStream
Start creating a change stream operation for the given domainType watching all collections within the database.
Consider limiting events be defining acollectionand/orfilter.- Parameters:
domainType- must not be null. UseDocumentto obtain raw elements.- Returns:
- new instance of
ReactiveChangeStreamOperation.ReactiveChangeStream. Never null. - Throws:
IllegalArgumentException- if domainType is null.
-