Database

[{directConfigs:[{type:"Type A",result:{priority:2,id:ObjectId("63c6a4b858612f44f37d4771")}},{type:"Type B",result:{priority:3,id:ObjectId("63bd7878f1f085f7d8a6827f")}}],indirectConfigs:[{type:"Type A",result:{priority:1,id:ObjectId("627279d3ba7aef5d6418c867")}},{type:"Type C",result:{priority:5,id:ObjectId("63be730bf1f085f7d8a682c8")}}],}]

Query

db.collection.aggregate([{$project:{_id:0,result:{$reduce:{input:"$indirectConfigs",initialValue:"$directConfigs",in:{$concatArrays:["$$value",{$cond:[{$not:{$in:["$$this.type","$$value.type"]}},["$$this"],[]]}]}}}}}])

Result