[SERVER-36832] Allow $out to different database Created: 23/Aug/18 Updated: 06/Dec/22 Resolved: 17/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kyle Suarez | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | open_todo_in_code | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Query
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
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 DescriptionIn We will prohibit $out with mode "replaceCollection" to a foreign database in |
| Comments |
| Comment by Ted Tuckman [ 17/Mar/20 ] | |||||||||||||||||||||||||||||||||||
|
This was done as part of closing the gap between map reduce and aggregation in | |||||||||||||||||||||||||||||||||||
| Comment by Charlie Swanson [ 04/Jun/19 ] | |||||||||||||||||||||||||||||||||||
|
nicholas.zolnierz I adjusted the title/description so I think this makes more sense now? | |||||||||||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 11/Sep/18 ] | |||||||||||||||||||||||||||||||||||
|
kyle.suarez it’s not very important - in fact it’s okay to drop that. | |||||||||||||||||||||||||||||||||||
| Comment by Kyle Suarez [ 11/Sep/18 ] | |||||||||||||||||||||||||||||||||||
|
After much discussion with esha.maharishi, nicholas.zolnierz, charlie.swanson and david.storch, we've decided that the code that would be written to support this would be duplicating work planned for the "All collections are sharded" Sharding Team project. asya, how important is it that we support "replaceCollection" mode to a foreign database? Important enough that it must land in 4.2? If so, we believe the correct move is to then prioritize the dependencies in the Sharding Team project appropriately and then revisit this ticket when that time comes. | |||||||||||||||||||||||||||||||||||
| Comment by Kyle Suarez [ 05/Sep/18 ] | |||||||||||||||||||||||||||||||||||
|
When we do this, friendly reminder to update the authz tests in jstests/aggregation/sources/out/bypass_doc_validation.js and jstests/auth/lib/commands_lib.js as well. | |||||||||||||||||||||||||||||||||||
| Comment by Kyle Suarez [ 27/Aug/18 ] | |||||||||||||||||||||||||||||||||||
|
My tests for the positive version in
|