For those that were looking for a solution here it is:
var name="Peter";
model.findOne({name: new RegExp('^'+name+'$', "i")}, function(err, doc) {
//Do your action here..
});
For those that were looking for a solution here it is:
var name="Peter";
model.findOne({name: new RegExp('^'+name+'$', "i")}, function(err, doc) {
//Do your action here..
});