balderdashy/sails-mongo — pull request #211 by Ignigena (2014-11-28 22:24:26+00:00)
Title: Fixes error with 'not' query against string field.

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`