diff options
Diffstat (limited to 'src/mongo/db/pipeline/document_source_facet.h')
-rw-r--r-- | src/mongo/db/pipeline/document_source_facet.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/document_source_facet.h b/src/mongo/db/pipeline/document_source_facet.h index 570e55b1907..bc8f8dad307 100644 --- a/src/mongo/db/pipeline/document_source_facet.h +++ b/src/mongo/db/pipeline/document_source_facet.h @@ -57,7 +57,7 @@ class NamespaceString; * stage which will produce a document like the following: * {facetA: [<all input documents except the first one>], facetB: [<the first document>]}. */ -class DocumentSourceFacet final : public DocumentSource { +class DocumentSourceFacet final : public DocumentSource, public NeedsMergerDocumentSource { public: struct FacetPipeline { FacetPipeline(std::string name, std::unique_ptr<Pipeline, PipelineDeleter> pipeline) @@ -126,9 +126,11 @@ public: * TODO SERVER-24154: Should be smarter about splitting so that parts of the sub-pipelines can * potentially be run in parallel on multiple shards. */ - boost::optional<MergingLogic> mergingLogic() final { - // {shardsStage, mergingStage, sortPattern} - return MergingLogic{nullptr, this, boost::none}; + boost::intrusive_ptr<DocumentSource> getShardSource() final { + return nullptr; + } + MergingLogic mergingLogic() final { + return {this}; } const std::vector<FacetPipeline>& getFacetPipelines() const { |