Database
[{typeCount:[{_id:"System",count:1002},{_id:"Application",count:3065},],affectedComputers:[{},{},{}]}]
Query
db.collection.aggregate([{$replaceRoot:{newRoot:{$mergeObjects:[{"affectedComputers":{$size:"$affectedComputers"}},{"$arrayToObject":{$map:{input:"$typeCount",in:{k:"$$this._id",v:"$$this.count"}}}}]}}}])