Database

[{"pipe1":[{"_id":1,"count":3},{"_id":2,"count":2},],"pipe2":[{"_id":1,"sum":6},{"_id":2,"sum":8},]}]

Query

db.collection.aggregate([{"$project":{"newRoot":{"$concatArrays":["$pipe1","$pipe2",]}}},{"$unwind":"$newRoot"},{"$group":{"_id":"$newRoot._id","sum":{"$sum":"$newRoot.sum"},"count":{"$sum":"$newRoot.count"},},},])

Result