Mongoose Query n[SOLVED]

let extractTags = (req,res) =>{
    Data.find({ tags : 'hav' }, function (err, data) {    


    var tag = req.query.tag
    Data.find({ tags : tag}, function(err, 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’)

What was the solution to your problem?

I was passing the query wrong

i was doing localhost:5000?extractTags=“hav”

So the tag in this case was “\“hav\””

Just had to did localhost:5000?extractTags=hav