Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-41922

Explain on $lookup ("let and pipeline" form) throws

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 4.0.10
    • Aggregation Framework
    • None
    • ALL
    • Hide

      db.getCollection("threads").explain().aggregate("'$lookup': { 'from': 'posts', 'let':

      { 'postsIds': '$Posts' }

      , 'pipeline': [ { '$match': { '$expr':

      { '$in': [ '$_id' '$$postsIds' ] }

      } } ], 'as': 'LastPosts' }")

      Show
      db.getCollection("threads").explain().aggregate("'$lookup': { 'from': 'posts', 'let': { 'postsIds': '$Posts' } , 'pipeline': [ { '$match': { '$expr': { '$in': [ '$_id' '$$postsIds' ] } } } ], 'as': 'LastPosts' }")

    Description

      I try to get plan of my aggregation including complex lookup to figure out could it utilize index of joined collection or not.

      End even with simplified example (in selfdescribing repro) I get error "Expected 'pipeline' to be BSON docs (or equivalent), but got []interface {} instead."

      Attachments

        Activity

          People

            eric.sedor@mongodb.com Eric Sedor
            serggladskikh@yandex.ru Segey Gladskikh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: