diff options
author | Svilen Mihaylov <svilen.mihaylov@mongodb.com> | 2020-07-14 11:27:03 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-22 21:25:48 +0000 |
commit | 4f1d4c54ab1270dc61edd5931e0e77f524a7b989 (patch) | |
tree | b4d2255a77c24f373cf016ebe0b74e7f3659d59e /src/mongo/db/pipeline/pipeline.cpp | |
parent | 19db8ebda506ddcd3f4e477fb9bd4228867e6ca3 (diff) | |
download | mongo-4f1d4c54ab1270dc61edd5931e0e77f524a7b989.tar.gz |
SERVER-48731 Inclusion of FLE support in the shell drags too much of the query system in
Diffstat (limited to 'src/mongo/db/pipeline/pipeline.cpp')
-rw-r--r-- | src/mongo/db/pipeline/pipeline.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp index f3fc921a6ee..893316623b8 100644 --- a/src/mongo/db/pipeline/pipeline.cpp +++ b/src/mongo/db/pipeline/pipeline.cpp @@ -27,28 +27,20 @@ * it in the license file. */ -#include "mongo/platform/basic.h" - #include "mongo/db/pipeline/pipeline.h" #include <algorithm> #include "mongo/base/error_codes.h" #include "mongo/db/bson/dotted_path_support.h" -#include "mongo/db/catalog/document_validation.h" #include "mongo/db/exec/document_value/document.h" #include "mongo/db/jsobj.h" #include "mongo/db/operation_context.h" #include "mongo/db/pipeline/accumulator.h" #include "mongo/db/pipeline/document_source.h" -#include "mongo/db/pipeline/document_source_geo_near.h" #include "mongo/db/pipeline/document_source_match.h" #include "mongo/db/pipeline/document_source_merge.h" #include "mongo/db/pipeline/document_source_out.h" -#include "mongo/db/pipeline/document_source_project.h" -#include "mongo/db/pipeline/document_source_sort.h" -#include "mongo/db/pipeline/document_source_unwind.h" -#include "mongo/db/pipeline/expression.h" #include "mongo/db/pipeline/expression_context.h" #include "mongo/db/storage/storage_options.h" #include "mongo/util/fail_point.h" @@ -328,21 +320,16 @@ bool Pipeline::usedDisk() { } BSONObj Pipeline::getInitialQuery() const { - if (_sources.empty()) - return BSONObj(); - - /* look for an initial $match */ - DocumentSourceMatch* match = dynamic_cast<DocumentSourceMatch*>(_sources.front().get()); - if (match) { - return match->getQuery(); + if (_sources.empty()) { + return BSONObj{}; } - DocumentSourceGeoNear* geoNear = dynamic_cast<DocumentSourceGeoNear*>(_sources.front().get()); - if (geoNear) { - return geoNear->getQuery(); + const DocumentSource* doc = _sources.front().get(); + if (doc->hasQuery()) { + return doc->getQuery(); } - return BSONObj(); + return BSONObj{}; } bool Pipeline::needsPrimaryShardMerger() const { |