From 9955e3ab374e26b8428378dfabf94ce89f00aaa6 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Fri, 7 Feb 2020 20:31:11 +0000 Subject: SERVER-45530 Implement $match and $project duplication and pushdown across $unionWith --- src/mongo/db/pipeline/document_source_match.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mongo/db/pipeline/document_source_match.h') diff --git a/src/mongo/db/pipeline/document_source_match.h b/src/mongo/db/pipeline/document_source_match.h index a684c4c82f8..ecdda5dc274 100644 --- a/src/mongo/db/pipeline/document_source_match.h +++ b/src/mongo/db/pipeline/document_source_match.h @@ -30,16 +30,24 @@ #pragma once #include +#include #include #include "mongo/client/connpool.h" #include "mongo/db/matcher/matcher.h" #include "mongo/db/pipeline/document_source.h" +#include "mongo/util/intrusive_counter.h" namespace mongo { class DocumentSourceMatch : public DocumentSource { public: + template + friend boost::intrusive_ptr make_intrusive(Args&&...); + virtual boost::intrusive_ptr clone() const { + return make_intrusive>(*this); + } + static constexpr StringData kStageName = "$match"_sd; /** * Convenience method for creating a $match stage. @@ -170,6 +178,11 @@ public: } protected: + DocumentSourceMatch(const DocumentSourceMatch& other) + : DocumentSourceMatch( + other.serialize().getDocument().toBson().firstElement().embeddedObject(), + other.pExpCtx) {} + GetNextResult doGetNext() override; DocumentSourceMatch(const BSONObj& query, const boost::intrusive_ptr& expCtx); -- cgit v1.2.1