[SERVER-4540] Allow specification of a shard key for sharded map/reduce output Created: 21/Dec/11 Updated: 06/Dec/22 Resolved: 09/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 2.0.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Colin Marc | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | map_reduce, sharding | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Sharding
|
||||
| Participants: | |||||
| Description |
|
According to the map/reduce "sharded output" documentation, the sharded collection created by a map/reduce with sharded flag uses _id as the shard key. It would be really helpful to be able to specify a shard key for the output collection. |
| Comments |
| Comment by Charlie Swanson [ 09/Mar/20 ] |
|
This is not an improvement we plan on making. However, the aggregation framework and the $merge stage can merge to a collection with a different shard key. |
| Comment by Santiago Alessandri [ 10/Jun/14 ] |
|
+1 This is a feature that would be extremely helpful. Not always - and I might say most of the time - the best sharding key is not the _ id field. I haven't found a decent workaround for this issue. |