summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/sort_pattern.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/sort_pattern.h')
-rw-r--r--src/mongo/db/query/sort_pattern.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/query/sort_pattern.h b/src/mongo/db/query/sort_pattern.h
index 1b55472a79b..bed9b338535 100644
--- a/src/mongo/db/query/sort_pattern.h
+++ b/src/mongo/db/query/sort_pattern.h
@@ -105,10 +105,19 @@ public:
return _sortPattern[idx];
}
+ /**
+ * Returns true if this SortPattern is an extension of the other.
+ */
+ bool isExtensionOf(const SortPattern& other) const;
+
bool operator==(const SortPattern& other) const {
return _sortPattern == other._sortPattern && _paths == other._paths;
}
+ bool operator!=(const SortPattern& other) const {
+ return !(*this == other);
+ }
+
std::vector<SortPatternPart>::const_iterator begin() const {
return _sortPattern.cbegin();
}