javascript - MongoDB Combine data from multiple collections -


i'm trying combine 3 collections one

the first collection make of vehicles

vehicle {     "_id" : ,     "vehicle_id" : ,     "engine_id" : ,     "service_schedule_id" :  } 

the other 2 service schedules , parts

service_schedule {     "service_schedule_id" : ,     "date" : ,     "description" : }   parts {     "part_id" : ,     "vehicle_id" : ,     "description" :,      "name" :  } 

what want combine them in end have 1 collection instead of having id's contains actual information collection

vehicle_complete {     "_id" : ,     "vehicle_id" : ,     "engine_id" : ,     "service_schedule" :          {            "service_schedule_id" : ,            "date" : ,            "description" :,            "parts" :           },     "parts" :       [         {            "part_id" : ,            "description" :,             "name" :           }       ] } 

i've seen similar questions use mapreduce nothing far has worked me.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -