查询个数 使用count方法 db.collection1.count({}) // 查询总共有几条数据 db.collection1.count({category:'fruit'}) // 查询满足条件的有几条数据