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
This commit is contained in:
committed by
Christoph Strobl
parent
830fad957e
commit
d4dc13894a
@@ -1852,7 +1852,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
|
||||
|
||||
Reference in New Issue
Block a user