1、查询统计总数: db.getCollection("student").count(); 2、查询统计根据某个字段去重后的总数: db.getCollection("student").distinct("name").length;