Skip to content

Commit

Permalink
Merge 6609a4b into 479b9bd
Browse files Browse the repository at this point in the history
  • Loading branch information
brozeph committed Apr 28, 2015
2 parents 479b9bd + 6609a4b commit 9a819ef
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/filter.js
Expand Up @@ -114,10 +114,19 @@ module.exports = function(mongoose) {
val);
};

// boolean values should be handled as booleans, not string values
var regexExact = function (val) {
return (typeof val === 'string' ?
new RegExp('^' + sanitize(val) + '$', 'i') :
val);
if (typeof val === 'string') {
switch(val.toLowerCase()) {
case 'false' :
return false;
case 'true' :
return true;
default :
return new RegExp('^' + sanitize(val) + '$', 'i');
}
}
return val;
};

// MANDATORY
Expand Down

0 comments on commit 9a819ef

Please sign in to comment.