Interface ReactiveSessionCallback<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback interface for executing operations within a
ClientSession
using
reactive infrastructure.- Since:
- 2.1
- Author:
- Christoph Strobl
- See Also:
-
ClientSession
-
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<T>
doInSession
(ReactiveMongoOperations operations) Execute operations against a MongoDB instance via session boundReactiveMongoOperations
.
-
Method Details
-
doInSession
Execute operations against a MongoDB instance via session boundReactiveMongoOperations
. The session is inferred directly into the operation so that no further interaction is necessary.
Please note that only Spring Data-specific abstractions likeReactiveMongoOperations.find(Query, Class)
and others are enhanced with theClientSession
. When obtaining plain MongoDB gateway objects likeMongoCollection
orMongoDatabase
via eg.ReactiveMongoOperations.getCollection(String)
we leave responsibility forClientSession
again up to the caller.- Parameters:
operations
- will never be null.- Returns:
- never null.
-