diff options
Diffstat (limited to 'src/mongo/db/pipeline/document_source_bucket_auto.h')
-rw-r--r-- | src/mongo/db/pipeline/document_source_bucket_auto.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/document_source_bucket_auto.h b/src/mongo/db/pipeline/document_source_bucket_auto.h index cbcce1f46bc..e75d4d16558 100644 --- a/src/mongo/db/pipeline/document_source_bucket_auto.h +++ b/src/mongo/db/pipeline/document_source_bucket_auto.h @@ -43,7 +43,7 @@ namespace mongo { * The $bucketAuto stage takes a user-specified number of buckets and automatically determines * boundaries such that the values are approximately equally distributed between those buckets. */ -class DocumentSourceBucketAuto final : public DocumentSource { +class DocumentSourceBucketAuto final : public DocumentSource, public NeedsMergerDocumentSource { public: Value serialize(boost::optional<ExplainOptions::Verbosity> explain = boost::none) const final; DepsTracker::State getDependencies(DepsTracker* deps) const final; @@ -62,9 +62,11 @@ public: /** * The $bucketAuto stage must be run on the merging shard. */ - 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}; } static const uint64_t kDefaultMaxMemoryUsageBytes = 100 * 1024 * 1024; |