aravindnc/mongoose-paginate-v2

Seems like fulltext search is impossible?

trancephorm opened this issue · 1 comments

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",
    })
  });
};```

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