I'm trying to search string using regex as below:
db.find({ consignee: { $regex: /test/ } }, function (err, docs) {
});
But it is throwing error
Error: $regex operator called with non regular expression
I'm trying to search string using regex as below:
db.find({ consignee: { $regex: /test/ } }, function (err, docs) {
});
But it is throwing error
Error: $regex operator called with non regular expression