Skip to content

DOCS-13229 Correcting merging in sharded cluster statement #4923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions source/core/aggregation-pipeline-sharded-collections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ to be done on the primary shard.
.. versionchanged:: 3.6

When aggregation operations run on multiple shards, the results are
routed to the :binary:`~bin.mongos` to be merged. However, :pipeline:`$out`
and :pipeline:`$lookup` must run on the :ref:`primary shard <primary-shard>`
and are aggregated there.
routed to the :binary:`~bin.mongos` to be merged except when :pipeline:`$out`
and :pipeline:`$lookup` are present, and must merge on the :ref:`primary
shard <primary-shard>` or when :ref:`allowDiskUse` is true and there is a
sorting or grouping stage present in which case one of the shards will be
randomly selected to perform the merge.

Optimization
------------
Expand Down