2013-07-12 37 views

回答

3

請記住這是javascript代碼,因此您可以使用length獲得一個數組的計數。

db.students.distinct('class_id').length

3
db.students.distinct('class_id').length