@FunctionalInterface public interface SessionCallback<T>
@Nullable T doInSession(MongoOperations operations)
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
MongoOperations.getCollection(String)we leave responsibility for
ClientSessionagain up to the caller.
operations- will never be null.
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.