Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-2886

"As" array returned by $lookup stage does not display correctly in sample of documents

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 1.14.0-beta.1
    • Aggregation pipeline
    • None
    • OS X
    • Sprint Vanilla Ice, Sprint Wyclef Jean

    Description

      Running the following aggregation pipeline query against the air_alliances and air_airlines datasets from the M121 course, the sample documents returned do not display the contents of the returned as: "alliance" array (you can see the empty array in the attached screenshot).   The subsequent match query displays the results correctly, so this is a display bug not an aggregation pipeline bug.

       db.air_airlines.aggregate(
      [
      {"$match": {"country":

      {"$in": ["Spain", "Germany", "Canada"]}

      }},
      {"$lookup": {
      "from": "air_alliances",
      "foreignField": "airlines",
      "localField": "name",
      "as": "alliance"
      }},
      {"$match": {"alliance.name": "OneWorld"}}
      ])

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            chuck.kalmanek@mongodb.com Charles Kalmanek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: