aravindnc / mongoose-paginate-v2

A custom pagination library for Mongoose with customizable labels.

Home Page:https://www.npmjs.com/package/mongoose-paginate-v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seems like fulltext search is impossible?

trancephorm opened this issue · comments

commented

This piece of code gives internal server error:

    page: req.body.pg,
    limit: 50
  };
  let myQuery = [
     { $text : { $search: req.body.search } },     
    ];

  await Release
  .paginate(myQuery, options)
  .then(function (results) {
    return res.send(results);
  })
  .catch(function (err) {
    return res.status(500).json({
      error: true,
      message: "Error when retrieving records",
    })
  });
};```
commented

Sorry, my bad I was sending array instead of object for Query..