Normally $sort uses the needsMerge flag to decide whether to return the sort key as metadata:
https://github.com/10gen/mongo/blob/85409b314c52efaa1987d50291f2779dfa314328/src/mongo/db/pipeline/document_source_sort.cpp#L450-L455
Presumably we will need to do the same thing for $_internalBoundedSort.
- depends on
-
SERVER-64349 Add heuristic-based planning support for bucket unpacking with sort
- Closed
- is depended on by
-
SERVER-52286 Enable feature flag for Bucket unpacking with sorting
- Closed