Execute operations against a MongoDB instance via session bound
MongoOperations
. The session is inferred
directly into the operation so that no further interaction is necessary.
Please note that only Spring Data-specific abstractions like
MongoOperations.find(Query, Class)
and others
are enhanced with the
ClientSession
. When obtaining plain MongoDB gateway objects like
MongoCollection
or
MongoDatabase
via eg.
MongoOperations.getCollection(String)
we leave responsibility for
ClientSession
again up to the caller.