7

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

Rohit
  • 2,987
  • 3
  • 25
  • 50

0 Answers0