[SERVER-41199] Translate $out tests in jstests/sharding to use $merge Created: 17/May/19  Updated: 29/Oct/23  Resolved: 21/May/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.1.12

Type: Task Priority: Major - P3
Reporter: Charlie Swanson Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-41201 Add replacement for "withEachOutMode" Closed
is depended on by SERVER-41197 De-duplicate $out and $merge testing Closed
is depended on by SERVER-40432 Undo 4.2 changes to $out Closed
Related
related to SERVER-41198 Translate $out tests in jstests/aggre... Closed
related to SERVER-41200 Translate tests in other directories ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2019-06-03
Participants:

 Description   

For this task we just want to translate tests of modes "insertDocuments" and "replaceDocuments". Don't worry about removing duplicate coverage, that will be done by SERVER-41197.

Written as   Translates to

{$out: {
to: "x",
uniqueKey: {x_id: 1},
mode: "insertDocuments"
}}

{$merge: {
into: "x",
on: "x_id"
whenMatched: "fail",
whenNotMatched: "insert"
}}

{$out: {
to: "x",
uniqueKey: {x_id: 1},
mode: "replaceDocuments"
}}

{$merge: {
into: "x",
on: "x_id",
whenMatched: "replaceWithNew",
whenNotMatched: "insert"
}}



 Comments   
Comment by Githook User [ 21/May/19 ]

Author:

{'email': 'nicholas.zolnierz@mongodb.com', 'name': 'Nick Zolnierz', 'username': 'nzolnierzmdb'}

Message: SERVER-41199 Translate $out tests in jstests/sharding to use $merge
Branch: master
https://github.com/mongodb/mongo/commit/e5f78284ae4ca6a3bf37c7413883eaac4f912bc5

Comment by Anton Korshunov [ 17/May/19 ]

charlie.swanson I'm with you on this and prefer to SERVER-40432 as-is.

Comment by Charlie Swanson [ 17/May/19 ]

anton.korshunov I think you'll need to wait for this and related issues before pushing SERVER-40432. If you'd like we can probably split SERVER-40432 into a piece where we delete unneeded code and a piece where we delete the translation from $out to $merge on the server (and some more unneeded code). The former wouldn't depend on this. Up to you. I have also left the unit testing translation/de-duplication to SERVER-40432, which may be another way to split it up if you think it makes sense. I personally think it makes the most sense to keep SERVER-40432 as-is, but wanted to give you some options in case you didn't want to wait on this other stuff.

Generated at Thu Feb 08 04:57:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.