-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Query
4.2 added the $merge stage which does support outputting to a different database. It's a little trickier to add support for $out to output to a different database. In a sharded environment the target collection could live on a different shard.
Original Description
In SERVER-13201, we discovered that a $out to a different database with mode "replaceCollection" will not work properly in a sharded cluster when the primary shard of the source database differs from the primary shard of the output database. If they are different, DocumentSourceOutReplaceCollection will perform the rename operation on the primary shard of the source, rather than the primary shard of the output.
We will prohibit $out with mode "replaceCollection" to a foreign database in SERVER-13201. This ticket will then track the work to get the metadata operations working properly in a sharded cluster.
- depends on
-
SERVER-46110 expose $_internalOutToDifferentDB functionality
- Closed
-
SERVER-13201 Allow new Aggregation $merge stage to explicitly name a DB to write to
- Closed
- duplicates
-
SERVER-46110 expose $_internalOutToDifferentDB functionality
- Closed