I have managed to set up a search feature in my mongodb app. See the code below. This works very well however it only returns exact results. How would I change my code to make it accept more "fuzzy" search results? Thanks!
router.get("/", function(req, res){
if (req.query.search) {
Jobs.find({"name": req.query.search}, function(err, foundjobs){
if(err){
console.log(err);
} else {
res.render("jobs/index",{jobs:foundjobs});
}
});
}
Jobs.find({}, function(err, allJobs){
if(err){
console.log(err);
} else {
res.render("jobs/index",{jobs:allJobs});
}
});
});