var thename = \'Andrew\'; db.collection.find({\'name\':thename});
How do I query case insensitive? I want to find result even if \"andrew\";
The following query will find the documents with required string insensitively and with global occurrence also
db.collection.find({name:{ $regex: new RegExp(thename, "ig") } },function(err, doc) { //Your code here... });