Sharded view resolution in $lookup incorrectly updates index of match stage

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • QO 2021-09-06
    • 157
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In sharded $lookup, when the from field of the $lookup is a sharded view and a CommandOnShardedViewNotSupported exception is generated to resolve the pipeline for this view, it is necessary to update the index of the match stage for the field join (_fieldMatchPipelineIdx) to the correct value.

      The initial implementation incorrectly assumed that this stage would always be the last one in the pipeline. The solution is to update the old index of the match stage by adding the length of the view pipeline to it.

            Assignee:
            Alya Berciu
            Reporter:
            Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: