summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/canonical_query.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/canonical_query.h')
-rw-r--r--src/mongo/db/query/canonical_query.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/query/canonical_query.h b/src/mongo/db/query/canonical_query.h
index db2cb578b12..392c75ca704 100644
--- a/src/mongo/db/query/canonical_query.h
+++ b/src/mongo/db/query/canonical_query.h
@@ -148,6 +148,13 @@ public:
static Status isValid(MatchExpression* root, const QueryRequest& parsed);
/**
+ * Returns the normalized version of the subtree rooted at 'root'.
+ *
+ * Takes ownership of 'root'.
+ */
+ static MatchExpression* normalizeTree(MatchExpression* root);
+
+ /**
* Traverses expression tree post-order.
* Sorts children at each non-leaf node by (MatchType, path(), children, number of children)
*/
@@ -185,7 +192,7 @@ private:
Status init(std::unique_ptr<QueryRequest> qr,
bool canHaveNoopMatchNodes,
- std::unique_ptr<MatchExpression> root,
+ MatchExpression* root,
std::unique_ptr<CollatorInterface> collator);
std::unique_ptr<QueryRequest> _qr;