Mongoose finds why undefined is returned

exports.getAllStudent = function (req, res) {
    //
    var rows = url.parse(req.url, true).query.rows;
    var page = url.parse(req.url, true).query.page;
    var sidx = url.parse(req.url, true).query.sidx;
    var sord = url.parse(req.url, true).query.sord;

    var sordNumber = sord == "asc" ? 1 : -1;

    //
    Student.count({}, function (err, count) {
        //
        console.log(count)
        var total = Math.ceil(count / rows);
        console.log(total)
      
        var sortobj = {};
        //
        sortobj[sidx] = sordNumber;
        //
        //recordspagetotalrowsjqGrid
        //     http://blog.mn886.net/jqGrid/   demo
        //API:http://blog.mn886.net/jqGrid/JSONData
        /* Student.find({},function (err,results) {
             //console.log(results);
             res.json({"records" : count, "page" : page, "total" : total , "rows" : results});
         });*/
 
      
        /*.sort(sortobj)*/
        Student.find({}).limit(rows).skip(rows * (page - 1)).exec(function (err, results) {
            console.log(rows,page);
            console.log(results)
            res.json({"records": count, "page": page, "total": total, "rows": results});
        });
    });
};
Mar.28,2021

exec (function (err,results in the second find) {console.log (err)} you can know that there is a problem with the type of limit (rows). Add var rows = url.parse (req.url, true) .query.rows; = > var rows = parseInt (url.parse (req.url, true) .query.rows) in the declaration; then


let the problem owner know the reason at last?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ce66-41390.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ce66-41390.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?