db.集合名称.find({条件}).count()
db.集合名称.count({条件})
db.stu.find({gender:1}).count()
db.stu.count({age:{$gt:20},gender:1})