DocumentSourceMerge::createFromBson should parse whenMatched pipeline

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • ALL
    • Hide
      // changes on src/mongo/db/pipeline/document_source_merge_test.cpp file:
      
      TEST_F(DocumentSourceMergeTest, FailsToParseIncorrectWhenMatchedPipeline)
      {
           auto spec =
               BSON("$merge" << BSON("into" << "target_collection"
                                            << "whenMatched" << BSON_ARRAY(BSON("$addFields" << "2"))));
           ASSERT_THROWS_CODE(createMergeStage(spec), AssertionException, 40272);
       }
      Show
      // changes on src/mongo/db/pipeline/document_source_merge_test.cpp file: TEST_F(DocumentSourceMergeTest, FailsToParseIncorrectWhenMatchedPipeline) {     auto spec =         BSON("$merge" << BSON("into" << "target_collection"                                      << "whenMatched" << BSON_ARRAY(BSON("$addFields" << "2"))));     ASSERT_THROWS_CODE(createMergeStage(spec), AssertionException, 40272); }
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When an incorrect pipeline is set under the 'whenMatched' parameter of the $merge aggregation stage, DocumentSourceMerge::createFromBson() doesn't fail.

              Assignee:
              Unassigned
              Reporter:
              Silvia Surroca
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: