Permalink
Browse files

fixed; $in queries on mixed type (that are arrays) works

  • Loading branch information...
1 parent 99bf835 commit d5c2586b9be17f69d50ed83ae3e9ba93cfb5d5a7 @aheckmann aheckmann committed Mar 31, 2011
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/mongoose/schema/mixed.js
@@ -36,7 +36,7 @@ Mixed.prototype.__proto__ = SchemaType.prototype;
* @api private
*/
-Mixed.prototype.checkRequired = function (value) {
+Mixed.prototype.checkRequired = function (val) {
return true;
};
@@ -47,11 +47,14 @@ Mixed.prototype.checkRequired = function (value) {
* @api private
*/
-Mixed.prototype.cast = function (value) {
- return value;
+Mixed.prototype.cast = function (val) {
+ return val;
};
-Mixed.prototype.castForQuery = Mixed.prototype.cast;
+Mixed.prototype.castForQuery = function ($cond, val) {
+ if (arguments.length === 2) return val;
+ return $cond;
+};
/**
* Module exports.

0 comments on commit d5c2586

Please sign in to comment.