diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2016-06-21 13:47:18 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2016-06-24 18:07:36 -0400 |
commit | 752eb0f448987b3e4183beacc622f4e95e7803be (patch) | |
tree | 525ab64b7e0ae8a5e4fba3da7feefd34e2600581 /src/mongo/db/pipeline/document_source_unwind.cpp | |
parent | 7e3ce9cec306df5abb15c0c1a599023270cfb807 (diff) | |
download | mongo-752eb0f448987b3e4183beacc622f4e95e7803be.tar.gz |
SERVER-18966 Add the ability to exclude fields in $project stage
Diffstat (limited to 'src/mongo/db/pipeline/document_source_unwind.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_unwind.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/db/pipeline/document_source_unwind.cpp b/src/mongo/db/pipeline/document_source_unwind.cpp index 58a4d979146..b02723c1c94 100644 --- a/src/mongo/db/pipeline/document_source_unwind.cpp +++ b/src/mongo/db/pipeline/document_source_unwind.cpp @@ -230,11 +230,10 @@ Pipeline::SourceContainer::iterator DocumentSourceUnwind::optimizeAt( invariant(*itr == this); if (auto nextMatch = dynamic_cast<DocumentSourceMatch*>((*std::next(itr)).get())) { - const bool includeDollarPrefix = false; - std::set<std::string> fields = {_unwindPath.getPath(includeDollarPrefix)}; + std::set<std::string> fields = {_unwindPath.fullPath()}; if (_indexPath) { - fields.insert((*_indexPath).getPath(false)); + fields.insert((*_indexPath).fullPath()); } auto splitMatch = nextMatch->splitSourceBy(fields); @@ -267,14 +266,14 @@ Pipeline::SourceContainer::iterator DocumentSourceUnwind::optimizeAt( Value DocumentSourceUnwind::serialize(bool explain) const { return Value(DOC(getSourceName() << DOC( - "path" << _unwindPath.getPath(true) << "preserveNullAndEmptyArrays" + "path" << _unwindPath.fullPathWithPrefix() << "preserveNullAndEmptyArrays" << (_preserveNullAndEmptyArrays ? Value(true) : Value()) << "includeArrayIndex" - << (_indexPath ? Value((*_indexPath).getPath(false)) : Value())))); + << (_indexPath ? Value((*_indexPath).fullPath()) : Value())))); } DocumentSource::GetDepsReturn DocumentSourceUnwind::getDependencies(DepsTracker* deps) const { - deps->fields.insert(_unwindPath.getPath(false)); + deps->fields.insert(_unwindPath.fullPath()); return SEE_NEXT; } |