Does mongo not support distinct’s coherent operation

  mongodb, question

For example, if I want to obtain a non-unique course id with a score greater than 80 points, it can be easily implemented in mysql with group and where conditions, but it seems that this operation is not supported in Mongo. have you ever encountered such a problem? Or is there any good solution, is it really necessary to use the program to come and go after taking out all of them?

{
 score:97,
 className:'Math'
 }
db.users.aggregate(
 [
 {$match:{score:{$gt:80}}},
 {$group:{_id:'$className'}}
 ]
 )