Database

[{Name:"Peter",ID:1,Points:123},{ID:1,Github:"PPane",Points:456},{Name:"Alice",Github:"Alice1",Points:234},{Name:"Ben",Github:"Ben2",Points:231},{ID:2,Github:"Alice1",Points:567},{ID:"3",Github:"Ben2",Points:271},]

Query

db.collection.aggregate([{$group:{_id:"$ID",Name:{"$first":"$Name"},Github:{"$first":"$Github"}}},{$match:{_id:{$ne:null}}},{$lookup:{from:"collection",let:{github:"$Github",iD:"$_id"},pipeline:[{$match:{$expr:{$or:[{$eq:["$$github","$Github"]},{$eq:["$$iD","$ID"]}]}}},{$group:{_id:0,Name:{$addToSet:"$Name"},Github:{$addToSet:"$Github"},ID:{$addToSet:"$ID"},Points:{$push:"$Points"}}}],as:"docs"}},{"$replaceRoot":{"newRoot":{$first:"$docs"}}},{$project:{_id:[{$first:"$Name"},{$first:"$ID"},{$first:"$Github"}],Points:1}}])

Result