问题 I want to make a pagination with Nodejs and Mongoose. I can limit the posts but I couldn't handle the connection of front-end to back-end. this is app.js: app.get('/', function (req, res) { var perPage = 2 var page = req.params.page || 1 Metin .find({}) .skip((perPage * page) - perPage) .limit(perPage) .exec(function(err, metins) { Metin.count().exec(function(err, count) { if (err) return next(err) res.render('index', { metins: metins, current: page, pages: Math.ceil(count / perPage) }) }) })