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}},{"$project":{"comp.teams":1,"teamId":1}},{"$group":{"_id":"$teamId","results":{"$push":"$comp.teams"}}}])

Result