Skip to content

Commit b43c09d

Browse files
Avoid unnecessary mapping of Sort object.
Closes: #4846
1 parent 538399a commit b43c09d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -2593,9 +2593,10 @@ protected <S, T> List<T> doFind(String collectionName,
25932593
QueryContext queryContext = queryOperations.createQueryContext(new BasicQuery(query, fields));
25942594
Document mappedFields = queryContext.getMappedFields(entity, EntityProjection.nonProjecting(entityClass));
25952595
Document mappedQuery = queryContext.getMappedQuery(entity);
2596-
Document mappedSort = getMappedSortObject(query, entityClass);
25972596

25982597
if (LOGGER.isDebugEnabled()) {
2598+
2599+
Document mappedSort = getMappedSortObject(query, entityClass);
25992600
LOGGER.debug(String.format("find using query: %s fields: %s sort: %s for class: %s in collection: %s",
26002601
serializeToJsonSafely(mappedQuery), mappedFields, serializeToJsonSafely(mappedSort), entityClass,
26012602
collectionName));

0 commit comments

Comments
 (0)