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
I had problems with this recently, i use this code and work fine for me.
var data = 'Peter'; db.User.find({'name' : new RegExp(data, 'i')}, function(err, docs){ cb(docs); });
Use directly /Peter/i work, but i use '/'+data+'/i' and not work for me.
/Peter/i
'/'+data+'/i'