Database

db={"competitions":[{"_id":10000,"teams":[{"_id":100,"name":"team 1"},{"_id":101,"name":"team 2"}]}],"scores":[{"competitionId":10000,"teamId":100,"score":100,"type":"league"}]}

Query

db.scores.aggregate([{$match:{"type":"league"}},{$lookup:{"from":"competitions","localField":"competitionId","foreignField":"_id","as":"comp"}},{$unwind:{"path":"$comp","preserveNullAndEmptyArrays":true}},{$unwind:{"path":"$comp.teams","preserveNullAndEmptyArrays":true}},{$group:{"_id":"$comp.teams._id","results":{$push:"$comp.teams"}}}])

Result