I’ve successfully completed the lab, but with the “detailed answer” came more questions as I started comparing it to my approach…
Why do we need an $unwind stage for instance? Does it fulfill the sole purpose of converting the “alliance” array into a string? We know an airline can only belong to one alliance, so is a new stage really necessary?
My approach on that was to just create a new field in a $project stage to trim the documents using the $arrayElemAt method in order to get back a string from the alliance array, since it seemed more memory-efficient to me and allows to trim down documents to the bare needed minimum… Does my logic makes any sense?
This one has to do with the formulation of the lab: " Which alliance from air_alliances flies the most routes with either a Boeing 747 or an Airbus A380 (abbreviated 747 and 380 in air_routes)?".
I personally found it misleading, since it is not clear if the airplane should be exclusively or inclusively a 747 or 380: The term “either” kind of leads one to think it’s exclusive and that the route should only feature one of them, while many routes feature a few different airplanes, and using the regex as everyone else, I found out that routes matching /747|380/ also displayed other airplanes…
So maybe something along the lines of “Which alliance fly the most routes using a Boeing 747 or an Airbus A380 amongst the route airplanes (abbreviated 747 and 380 in air_routes)?” would be a tad more specific. English is not my native language so don’t take my word(ing) for it, but you get the idea. On my end I was actually planning to test the different possibilities, but hey, I got lucky the first time
This is a more general thing, but I feel it would be nice to add a connection string to the lab to allow one to connect to the database through Compass… I messed around with the provided connection string but wasn’t able to connect that way
I unfortunately don’t have a deep enough understanding of how one should write connection strings (not talking about URIs, which have a very clear structure but unfortunately don’t work sometimes…)
In any case, this was a cool and challenging exercise, thanks to the team