Currently, when a sharded pipeline is explained, we expose a boolean field needsPrimaryShardMerger to indicate whether the merge part of the pipeline must be run on the database's primary shard. Given that
SERVER-22760 will make it possible for mongoS to merge directly from the shards, this explain format should be updated to provide more detailed information.
Some possible approaches include:
- A string field mergerType which simply takes the value of mongos or mongod
- A more detailed merger field identifying the shard or mongos which is to perform the merge. Note that in the case of a shard merge, this information may not be available at explain time.