We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
According to comments from @aheckmann around the internets (eg https://groups.google.com/d/msg/mongoose-orm/d9crUPzMEvk/G23HFlyalokJ), the following query with a literal regular expression should work using Mongoose:
Model.find({ foo: /bar/i });
But it does not, ie it returns an empty set. The correct way seems to be:
Model.find({ foo: {$regex:'bar', $options:'i'} })
More details: https://gist.github.com/gaarf/5256378/raw/d0214f395706961cff058098663731904cfe88d5/gistfile1.txt
The text was updated successfully, but these errors were encountered:
Cannot reproduce. https://gist.github.com/aheckmann/5257502
Sorry, something went wrong.
No branches or pull requests
According to comments from @aheckmann around the internets (eg https://groups.google.com/d/msg/mongoose-orm/d9crUPzMEvk/G23HFlyalokJ), the following query with a literal regular expression should work using Mongoose:
Model.find({ foo: /bar/i });
But it does not, ie it returns an empty set. The correct way seems to be:
Model.find({ foo: {$regex:'bar', $options:'i'} })
More details: https://gist.github.com/gaarf/5256378/raw/d0214f395706961cff058098663731904cfe88d5/gistfile1.txt
The text was updated successfully, but these errors were encountered: