I want to merge three objects together is possible?


#1

i am querying from three collections and want to merge three collections object is it possible or there is some problem in my query kindly give me hint i will be very thankful to you

Template.ExerciseMaster.helpers({

    'patientName': function () {

        var merged2 = EquipmentExercise.find().map(function(patient) {
            
         var q=  ExerciseMaster.findOne({'ExerciseMasterID':patient.ExerciseMasterID});
            var q2=  equipment.findOne({'EquipmentID':patient.EquipmentID});
            return _.extend(patient,q,q2);
        })
        console.log(merged2)
    }

});