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

$lookup should work right with array dot notation in localField

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 3.4.3
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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

          Issue Links

            Activity

              People

              Assignee:
              david.storch David Storch
              Reporter:
              futurist Jame Yang
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: