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
Post a Comment