Browse Source

Avoid obtaining mapped sort multiple times for mapReduce.

Apply already mapped sort for map reduce instead of running the source document through the mapping layer again.

Closes: #3960
3.2.x
blu10ph 4 years ago committed by Christoph Strobl
parent
commit
6cad96709d
No known key found for this signature in database
GPG Key ID: 8CC1AB53391458C8
  1. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

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

@ -1848,7 +1848,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, @@ -1848,7 +1848,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
Document mappedSort = getMappedSortObject(query, domainType);
if (mappedSort != null && !mappedSort.isEmpty()) {
mapReduce = mapReduce.sort(getMappedSortObject(query, domainType));
mapReduce = mapReduce.sort(mappedSort);
}
mapReduce = mapReduce

Loading…
Cancel
Save