let extractTags = (req,res) =>{
Data.find({ tags : 'hav' }, function (err, data) {
res.json(data)
}
------------------------------------------------------------------------------
var tag = req.query.tag
Data.find({ tags : tag}, function(err, data){
res.json(data)
}
})
tags schema type is Array. When i pass ‘hav’ explicitly the query return the desired result.
But when i try to pass it through a variable it returns empty object (i have checked the variable value is ‘hav’)