I am trying to pull out the results from mongoDB using mongoose ORM. The below code part worked perfectly and returned the exact matches of 'Test'
db.getCollection('cards').find({
$where: "this.name=='Test'"
})
I actually wanted to pull out the case-insensitive matches of 'Test'.
Below one worked,
db.getCollection('cards').find({"name":/test/i})
But I wanted to use regex on $where as below,
db.getCollection('cards').find({
$where: "this.name=='/Test/i'"
})
can someone throw some light or direction on how to address regex within $where?