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
pull/4007/head
blu10ph 4 years ago committed by Christoph Strobl
parent
commit
67b1fe5fbc
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

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

Loading…
Cancel
Save