-
Type:
Improvement
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework, Sharding
-
None
-
Fully Compatible
This currently happens automatically if the split-point is a $group, but not if it is a $sort, $skip, or $limit. If any of the mongos-only stages return EXHAUSTIVE from getDependencies(), but none of the shard stages do, then a $project should be added to the end of the shard stages.
Advantages:
- reduce mongod -> mongos network traffic
- allow mongod to reify only needed fields
- allow more documents to be output from a shard before hitting 16MB limit.