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

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

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

      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'
        }}
      ])
      

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 4 weeks ago