How to merge two collection array?

MainTraveller.aggregate([
{
  $match: {
    _id: mongoose.Types.ObjectId(req.query.id),
  },
},

{
  $lookup: {
    from: "subassemblies",
    localField: "SubAssemblies.SubAssyId",
    foreignField: "_id",
    as: "subassemblies",
  },
},
{
  $project: {
    _id: 0,
    ProductId: 0,
    TemplateRevisionNum: 0,
    SerialNum: 0,
    FinishedTasks: 0,
    WorkTasks: 0,
    __v: 0,
  },
},
]).then((travellerDetails) => {
if (travellerDetails.length) {
  return res.send(travellerDetails);
} else {
  return res.status(500).json({
    message: "Some error occured while retrieving traveller",
  });
}
});
};

The result return at the following

 {
    "SubAssemblies": [
        {
            "SubAssyId": "63aa8b12c0671d8a31cabf33",
            "CurrentSerialNum": 99,
            "ExchangeHistory": [
                11
            ],
            "_id": "63ad718852fb1827115a9be5"
        }
    ],
    "subassemblies": [
        {
            "_id": "63aa8b12c0671d8a31cabf33",
            "Name": "DDPP PCBA",
            "Prefix": "DDPP 20",
            "TemplateExists": false,
            "Templates": [
                {
                    "RevisionNum": "221227140634",
                    "EffectiveDate": "2022-12-27T06:02:31.674Z",
                    "WorkTasks": [],
                    "HasTraveller": false,
                    "_id": "63aa8b6ac0671d8a31cabf38"
                }
            ],
            "__v": 0
        }
    ]
}

I wish to get result like this. how to merge data in lookup?

{
 "subassemblies": [
        {
            "_id": "63aa8b12c0671d8a31cabf33",
            "CurrentSerialNum": 99,
            "ExchangeHistory": [
                11
            ],
            "Name": "DDPP PCBA",
            "Prefix": "DDPP 20",
            "TemplateExists": false,
            "Templates": [
                {
                    "RevisionNum": "221227140634",
                    "EffectiveDate": "2022-12-27T06:02:31.674Z",
                    "WorkTasks": [],
                    "HasTraveller": false,
                    "_id": "63aa8b6ac0671d8a31cabf38"
               }
            ],
        }
    ]
}

Hey @Min_Thein_Win,

Apologies for the late reply. It’s been a while since you posted this. Has this been resolved? If so, it would be great if you can share your approach with the community as it might help others too with a similar issue to yours. If the issue still persists, kindly share a sample document too so that we can try the aggregation at our end as well.

Regards,
Satyam