I need to query multiple collections in MongoDB. Here is an example of the data structure:
Collection stops {
{ stop_id : 1, stop_name: 'a'},
{ stop_id : 2, stop_name: 'b'}, ...
Collection stop_time {
{ stop_id : 1, trip_id: 40},
{ stop_id : 2, trip_id: 41}, ...
Collection trips {
{ trip_id : 40, route_id: 400},
{ trip_id : 41, route_id: 401}, ...
Collection route {
{ route_id : 400, route_name: 'foo'},
{ route_id : 401, route_name: 'bar'}, ...
I am looking for a way to determine the route_name that matches each stop_name. This data structure follows GTFS format.
Is there a straightforward way to perform queries that address this issue?
Thank you