From node js, i trying to retrieve the documents based on the keyword with case-insensitive. When i try directly from the mongo db console , i am able to see the result.
db.users.findOne({"displayName":{$regex: /.*abc./, $options:"i"}})
But when i try the same in node js, i am getting empty result.
var selector = { "displayName": {$regex: "/.*abc./", $options:"i"}}
is this due to regular expression not in javascript.
Can anyone please help me in this.