summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/exclusion_projection_executor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/exclusion_projection_executor.cpp')
-rw-r--r--src/mongo/db/exec/exclusion_projection_executor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/exec/exclusion_projection_executor.cpp b/src/mongo/db/exec/exclusion_projection_executor.cpp
index 9823ed1b125..2061bf4fe93 100644
--- a/src/mongo/db/exec/exclusion_projection_executor.cpp
+++ b/src/mongo/db/exec/exclusion_projection_executor.cpp
@@ -38,14 +38,15 @@ std::pair<BSONObj, bool> ExclusionNode::extractProjectOnFieldAndRename(const Str
BSONObjBuilder extractedExclusion;
// Check for a projection directly on 'oldName'. For example, {oldName: 0}.
- if (auto it = _projectedFields.find(oldName); it != _projectedFields.end()) {
+ if (auto it = _projectedFieldsSet.find(oldName); it != _projectedFieldsSet.end()) {
extractedExclusion.append(newName, false);
- _projectedFields.erase(it);
+ _projectedFieldsSet.erase(it);
+ _projectedFields.remove(std::string(oldName));
}
// Check for a projection on subfields of 'oldName'. For example, {oldName: {a: 0, b: 0}}.
if (auto it = _children.find(oldName); it != _children.end()) {
- extractedExclusion.append(newName, it->second->serialize(boost::none).toBson());
+ extractedExclusion.append(newName, it->second->serialize(boost::none, {}).toBson());
_children.erase(it);
}