summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression.h
diff options
context:
space:
mode:
authorDavid Hatch <david.hatch@mongodb.com>2016-07-01 15:34:05 -0400
committerDavid Hatch <david.hatch@mongodb.com>2016-07-06 16:43:48 -0400
commitc8c1ea166e7d15cc354dc87c3e4ec76cc9f3839b (patch)
tree016243f6075f9501e572490b272820412b4b2c23 /src/mongo/db/matcher/expression.h
parent8b91e7b1ad7ccff87b61afdecba864d15007db50 (diff)
downloadmongo-c8c1ea166e7d15cc354dc87c3e4ec76cc9f3839b.tar.gz
SERVER-24404 Make $push, $pullAll, and $pull respect collation.
Diffstat (limited to 'src/mongo/db/matcher/expression.h')
-rw-r--r--src/mongo/db/matcher/expression.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/matcher/expression.h b/src/mongo/db/matcher/expression.h
index 515e25ab5e1..a0ae4114991 100644
--- a/src/mongo/db/matcher/expression.h
+++ b/src/mongo/db/matcher/expression.h
@@ -41,6 +41,7 @@
namespace mongo {
+class CollatorInterface;
class MatchExpression;
class TreeMatchExpression;
@@ -234,6 +235,13 @@ public:
}
/**
+ * Set the collator 'collator' on this match expression and all its children.
+ *
+ * 'collator' must outlive the match expression.
+ */
+ void setCollator(const CollatorInterface* collator);
+
+ /**
* Serialize the MatchExpression to BSON, appending to 'out'. Output of this method is expected
* to be a valid query object, that, when parsed, produces a logically equivalent
* MatchExpression.
@@ -247,6 +255,12 @@ public:
virtual void debugString(StringBuilder& debug, int level = 0) const = 0;
protected:
+ /**
+ * Subclasses that are collation-aware must implement this method in order to capture changes
+ * to the collator that occur after initialization time.
+ */
+ virtual void _doSetCollator(const CollatorInterface* collator){};
+
void _debugAddSpace(StringBuilder& debug, int level) const;
private: