[COMPASS-2886] "As" array returned by $lookup stage does not display correctly in sample of documents Created: 26/May/18  Updated: 05/Jun/18  Resolved: 05/Jun/18

Status: Closed
Project: Compass
Component/s: Aggregation pipeline
Affects Version/s: 1.14.0-beta.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Charles Kalmanek Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X


Attachments: PNG File Screen Shot 2018-05-26 at 2.05.13 PM.png    
Sprint: 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"}}
])

 


Generated at Wed Feb 07 22:31:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.