-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$regex operator called with non regular expression #556
Comments
Can you consistently reproduce this error? Seems very odd. |
@jindalrohit have you figured out how to solve this issue ? |
@JamesMGreene I can reproduce this error now. The below function is used to find a book from the database based on the title of a book with regex. Library.searchBook = function (name) {
query = new RegExp(name, 'i');
console.log({query});
db.find({ title: { $regex: query } }, (err, result) => {
console.log({result});
if (err){
console.error(err);
return;
}
result.forEach(row => {
Library.loadBook(row);
});
});
}; The above function gives an error every time it gets executed. The function was working perfectly before, I don't know for which version. Now it is throwing error Error: $regex operator called with non regular expression. Current version is 1.8.0. Here is the screenshot of the output and you can see the code here. |
I have the same problem,and $where tip |
Same error. No idea how to remove this error. |
I cannot find any solution to this issue |
Same issue here:
|
I replaced nedb with sqlite, performance are better and migration was not so painful |
Use |
I'm trying to search string using regex as below:
db.find({ consignee: { $regex: /test/ } }, function (err, docs) {
console.log(docs);
});
But it is throwing error
Error: $regex operator called with non regular expression
The text was updated successfully, but these errors were encountered: