summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/parsed_exclusion_projection.h
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2016-12-13 10:15:08 -0500
committerCharlie Swanson <charlie.swanson@mongodb.com>2016-12-16 16:24:32 -0500
commit37e720678f6e468726c6cc775a5dc898d080f0f3 (patch)
tree4bd6b4932cc0ac436c0d7c949f7e37df613684d2 /src/mongo/db/pipeline/parsed_exclusion_projection.h
parent0cd2bf29d5798a395a07e67ae79ede9a5cefd411 (diff)
downloadmongo-37e720678f6e468726c6cc775a5dc898d080f0f3.tar.gz
SERVER-25535 Remove injectExpressionContext().
These methods were formally used to propagate a new ExpressionContext to stages, accumulators, or expressions which potentially needed to comparisons. Originally, this was necessary since Pipeline parsing happened outside of the collection lock and thus could not determine if there was a default collation on the collection. This meant that the collation could change after parsing and any operators that might compare strings would need to know about it. We have since moved parsing within the lock, so the collation can be known at parse time and the ExpressionContext should not change. This patch requires an ExpressionContext at construction time, and disallows changing the collation on an ExpressionContext.
Diffstat (limited to 'src/mongo/db/pipeline/parsed_exclusion_projection.h')
-rw-r--r--src/mongo/db/pipeline/parsed_exclusion_projection.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/parsed_exclusion_projection.h b/src/mongo/db/pipeline/parsed_exclusion_projection.h
index ea7b25ac33f..d0988d2d2cb 100644
--- a/src/mongo/db/pipeline/parsed_exclusion_projection.h
+++ b/src/mongo/db/pipeline/parsed_exclusion_projection.h
@@ -108,8 +108,8 @@ public:
/**
* Parses the projection specification given by 'spec', populating internal data structures.
*/
- void parse(const BSONObj& spec) final {
- parse(spec, _root.get(), 0);
+ void parse(const boost::intrusive_ptr<ExpressionContext>& expCtx, const BSONObj& spec) final {
+ parse(expCtx, spec, _root.get(), 0);
}
/**
@@ -134,7 +134,10 @@ private:
* Traverses 'spec' and parses each field. Adds any excluded fields at this level to 'node',
* and recurses on any sub-objects.
*/
- void parse(const BSONObj& spec, ExclusionNode* node, size_t depth);
+ void parse(const boost::intrusive_ptr<ExpressionContext>& expCtx,
+ const BSONObj& spec,
+ ExclusionNode* node,
+ size_t depth);
// The ExclusionNode tree does most of the execution work once constructed.