What is the problem that the formidable module in nodejs cannot get the data?

excuse me.
because of the small amount of data, I directly use find limit skip for paging
there is no problem when I use the code.

var page = 1;
    var pageSize = 5;
    var count = (page - 1) * pageSize;
    Coupon.find({}).limit(pageSize).skip(count).exec(function (err, rs) {
        res.json(rs);
    })

but you won"t get any data if you use it this way.

    var form = new formidable.IncomingForm();
    form.parse(req, function (err, fields, files) {
        Coupon.find({}).limit(fields.pageSize).skip((fields.page - 1) * fields.pageSize).exec(function (err, rs) {
            res.json(rs);
        })
    });

could you tell me how to solve the problem

Mar.04,2021

solved it by himself.
fields.page and fields.pageSize get the string
, so convert it to ok

.
fields.pageSize = parseInt(fields.pageSize);
fields.page= parseInt(fields.page);
Menu