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

$lookup should work right with array dot notation in localField

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 3.4.3
    • Aggregation Framework
    • None
    • ALL
    • Hide

      db.test.drop()
       
      db.test.insert({ "_id" : 1, "aa" : [ "bb" : { "id" : "1611e293-61c4-4028-b6fd-c5909247b020", "type": "form_charger" } ] })
       
      db.form_charger.insert({ "_id" : 1, "id" : "1611e293-61c4-4028-b6fd-c5909247b020" })
       
      db.test.aggregate([{ '$lookup': { from: 'form_charger', localField: 'aa.0.bb.id', foreignField: 'id', as: 'data_bb' } }])
      
      

      The result of *data_bb* always empty.

      Show
      db.test.drop()   db.test.insert({ "_id" : 1, "aa" : [ "bb" : { "id" : "1611e293-61c4-4028-b6fd-c5909247b020", "type": "form_charger" } ] })   db.form_charger.insert({ "_id" : 1, "id" : "1611e293-61c4-4028-b6fd-c5909247b020" })   db.test.aggregate([{ '$lookup': { from: 'form_charger', localField: 'aa.0.bb.id', foreignField: 'id', as: 'data_bb' } }]) The result of * data_bb * always empty.

    Description

      The $lookup stages now not work with dot notation when the path point into an embedded array.

      Attachments

        Activity

          People

            david.storch@mongodb.com David Storch
            futurist Jame Yang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: