Database

[{"collection":"collection","count":100,"content":{"_id":{"type":"autoincrement","autoType":"int","startInt":0},"name":{"type":"faker","method":"Name"},"grade":{"type":"enum","values":[9,10,11,12]}}}]

Query

db.collection.aggregate([{"$match":{"grade":{"$in":[10,11,12]}}},{"$group":{"_id":"$grade","name":{"$push":"$name"}}},{"$set":{"name":{"$slice":["$name",2]}}},{"$unwind":"$name"},{"$project":{"_id":0,"name":1,"grade":"$_id"}},{"$sort":{"grade":1,"name":1}}])

Result