I like to to go find a user in mongoDb by looking for a user called value. The problem with:
username: \'peter\'
is that i dont find it if
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.. });