"Global search in mysql using nodejs"
Bootstrap 4.1.1 Snippet by jatinbootsnipp

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ---------->
router.post("/search-employees", async (req, res) => { const searchTerm = req.body.searchTerm; try { const resp = await employee.findAll({ where: { [Op.or]: [ { name: { [Op.like]: '%' + searchTerm + '%'} }, { age: { [Op.like]: '%' + searchTerm + '%'} }, { country: { [Op.like]: '%' + searchTerm + '%'} }, { position: { [Op.like]: '%' + searchTerm + '%'} }, { wage: { [Op.like]: '%' + searchTerm + '%'} } ], }, }); res.status(200).send(resp); } catch (e) { res.status(400).send(e); } })

Related: See More


Questions / Comments: