Here is a rough example of an aggregation I did.
[{$lookup: {
from: 'skins',
localField: 'items._id',
foreignField: '_id',
as: 'merged'
}}, {$unwind: {
path: '$items'
}}, {$unwind: {
path: '$merged'
}}, {$project: {
test: {
$mergeObjects: [
'$merged',
'$items'
]
}
}}]
This merges the root level items in the object, but not the content in the “wears” array.