mongdb查询数据并且返回数据条数

 

 var totall;

var a = db.db("Magiccat").collection("jishi_content").find().count({}, function(err, res) {
if (err) {
console.log('error' + err);
return;
}
totall = res;
});
dbo.collection("jishi_content").find().skip(2).limit(limit).toArray(function(err, data) {
if (err) throw err;
callback(data);
db.close();
});

posted @ 2019-01-15 13:42  菜鸟程序员的总结  阅读(1632)  评论(0编辑  收藏  举报