I am creating a API using node js and mongo db. I want to implement a search. Here the following is my code
router.post('/searchstudents', async(req, res) => {
const qualifications = await Qualification.find({
qualification: /req.body.searchkey/
});
res.send(qualifications);
});
In here this req.body.searchkey
is identified as a string and does not give me the output.
How to use it as a variable so I can send random values ?
I want to use /someString/
as the like operator in Sql.