Skip to content
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

Fixes error with 'not' query against string field. #211

Merged
merged 1 commit into from
Nov 28, 2014
Merged

Fixes error with 'not' query against string field. #211

merged 1 commit into from
Nov 28, 2014

Conversation

Ignigena
Copy link
Contributor

Fixes an error that crashes Mongo when a "not" query is run against a field of type "string".

In the following query an error is thrown due to the modifier variable being passed to self.parseValue() not being correct:

Media.find().where({ type: { 'not': 'folder' } }).exec(function (err, results) { ... });

This results in the query being sent to Mongo as follows:

{ '$ne': /^folder$/i }

Which is invalid and crashes the server with the error MongoError: invalid regular expression operator

“MongoError: invalid regular expression operator” is thrown due to the
modifier being passed to parseValue not being correct.
particlebanana added a commit that referenced this pull request Nov 28, 2014
Fixes error with 'not' query against string field.
@particlebanana particlebanana merged commit 7cff143 into balderdashy:master Nov 28, 2014
@particlebanana
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants