diff options
Diffstat (limited to 'src/mongo/db/query/sort_pattern.cpp')
-rw-r--r-- | src/mongo/db/query/sort_pattern.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/query/sort_pattern.cpp b/src/mongo/db/query/sort_pattern.cpp index a7fff3f9061..185da1bb804 100644 --- a/src/mongo/db/query/sort_pattern.cpp +++ b/src/mongo/db/query/sort_pattern.cpp @@ -132,4 +132,14 @@ Document SortPattern::serialize(SortKeySerialization serializationMode) const { } return keyObj.freeze(); } + +void SortPattern::addDependencies(DepsTracker* deps) const { + for (auto&& keyPart : _sortPattern) { + if (keyPart.expression) { + keyPart.expression->addDependencies(deps); + } else { + deps->fields.insert(keyPart.fieldPath->fullPath()); + } + } +} } // namespace mongo |