NodeJS
search_key = new RegExp('.*' + req.params.search_key + '.*', 'i');
Item.find({product_name:search_key}).exec(function (err, items) {
console.log(items) );
});
Here I can search product name with the search_key. But my problem is, my product name is "COMPLAN MILK BISCUITS 100GM
". If I search with "BISCUITS COMPLAN
", its not finding that product. I need to find "BISCUITS COMPLAN
" and "COMPLAN BISCUITS
" based on contain in search.