Database

db={"score":[{tester_id:"1",test_id:"1",score:40},{tester_id:"1",test_id:"2",score:50},{tester_id:"1",test_id:"3",score:70},{tester_id:"2",test_id:"1",score:50},{tester_id:"3",test_id:"2",score:20},{tester_id:"3",test_id:"3",score:60},{tester_id:"7",test_id:"5",score:40},{tester_id:"8",test_id:"4",score:50},{tester_id:"9",test_id:"4",score:70},]}

Query

db.score.aggregate([{/** the tester of interest*/"$match":{"tester_id":"1"}},{"$lookup":{/** lookup by test_id*/"from":"score","localField":"test_id","foreignField":"test_id","let":{"myId":"$tester_id","myScore":"$score"},"pipeline":[{/** only return docs of different tester* and higher score*/"$match":{"$expr":{"$and":[{"$ne":["$tester_id","$$myId"]},{"$gt":["$score","$$myScore"]}]}}}],"as":"higherScores"}},{/** only keep non-empty higherScores*/"$match":{"$expr":{"$gt":[{"$size":"$higherScores"},0]}}},{/** only field we care about now*/"$project":{"higherScores":1}},{/** might be more than one*/"$unwind":"$higherScores"},{/** hoist it to ROOT*/"$replaceWith":"$higherScores"},{/** don't want _id*/"$unset":"_id"}])

Result