So I want to search for items in my database using mongoose .find() function.
In my router I have this code to get certain items from the url.
For example; 
mydomainname.com/market?type=1&name=hi&stats=123
   ...?type=123&name=&...
var type = req.query.type;
var name= req.query.name;
var stats= req.query.stats;
Model.find({type: type, name: name, stats: stats})
                .exec(function(err, model){
                    if(err){
                        console.log("error")
                    }else{
                        res.render('*jade*', {models: JSON.stringify(model)})
                    }})
This works fine, but when there is no query value in the url(as seen above) the query value will be set to ''. Which then sorts away every item I have on my database because there is none with exmaple name = '';
I have search around but I have not find any help so if any would be able to give me tip I would be grateful!
 
     
    