node使用Mongoose类库实现简单的增删改查

2020-06-17 06:38:48易采站长站整理

function getCountByConditions() {

User.count({}, function(err, res) {
if (err) {
console.log(err);
} else {
console.log(res); // 会输出数据库数据的数量
}
});
}
// 调用函数
getCountByConditions();