Database

db={"Topic":[{"_id":ObjectId("618c6718c6a8cc3a84a0b37f"),"subscribers":[{"userId":ObjectId("618c643545f4ecd43e9b20f7"),"points":{"daily":20,"total":70}},{"userId":ObjectId("618c641345f4ecd43e9b20f0"),"points":{"daily":10,"total":60}},{"userId":ObjectId("618c648c45f4ecd43e9b20fc"),"points":{"daily":15,"total":50}}],"quizzes":[],"leaderboards":{"daily":[{"userId":ObjectId("618c643545f4ecd43e9b20f7"),"points":{"daily":20,"total":70}},{userId:ObjectId("618c648c45f4ecd43e9b20fc"),points:{daily:15,total:50}},{"userId":ObjectId("618c641345f4ecd43e9b20f0"),"points":{"daily":10,"total":60}}],"total":[]}}]}

Query

db.Topic.aggregate([{$unwind:"$subscribers"},{$sort:{"subscribers.points.daily":-1}},{$group:{_id:"$_id","daily":{$push:"$subscribers"}}},{$project:{leaderboards:{daily:"$daily"}}},{"$merge":{"into":"Topic","on":"_id","whenMatched":"merge"}}])

Result