Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11203

Docs for SERVER-31760: Lookup sub-pipeline is not using index for equality match

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.7.1
    • Component/s: None
    • Labels:
      None

      Description

      Documentation Request Summary:

      The release notes list this ticket as a known issue in 3.6.0:

      https://docs.mongodb.com/manual/release-notes/3.6/#known-issues-in-3-6-0

      We will likely backport this fix, probably targeting 3.6.3. Do we need to do anything in the docs to reflect that the known issue has been resolved?

      Engineering Ticket Description:

      I am doing following aggregation to join two collection using foreign pipeline.
      It seems match stage is not using index at all.

      db.blogpost.aggregate([
        { $lookup: { 
          from: 'comment', 
          let: { blogpost_id: "$_id" }, 
          pipeline: [ { 
             $match: { $expr: { $eq: [ "$blogpost.id", "$$blogpost_id"] } } 
          } ], 
          as: 'comments'
        }}
      ])
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kay.kim Kay Kim
                Reporter:
                kay.kim Kay Kim
                Participants:
                Last commenter:
                Kian Andersson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since reply:
                  1 year, 29 weeks, 1 day ago
                  Date of 1st Reply: