Why dst_airport and src_airport is connectFrom and connectTo field

Why the dst_airport and src_airport is matched to get the one layover air routes

Which chapter, lab, quiz, exercise?

In chapter 3 lab of the M121 course. To find all possible routes, the query {
$graphLookup: {
startWith: “$airlines.base”,
from: “air_routes”,
connectFromField: “dst_airport”,
connectToField: “src_airport”,
as: “connections”,
maxDepth: 1
}
} is used. Why is the destination airport is matched to the source airport to find the routes?

A layover is Layover - Wikipedia.

So from src_airport:A to dst_airport:B is a direct route from A to B with no layover. However from src:A to dst:C then src:C to dst:B is a route with 1 layover from A to B. To be a layover, you have to leave from the airport (src_airport) from the same airport you arrived (dst_airport).

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.