Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit d5c2586b9be17f69d50ed83ae3e9ba93cfb5d5a7 1 parent 99bf835
@aheckmann aheckmann authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/mongoose/schema/mixed.js
View
11 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.
Please sign in to comment.
Something went wrong with that request. Please try again.