Comparing version 1.1.21 to 1.1.22
1.1.22 / 2011-03-31 | ||
=================== | ||
* Fixed; $in queries on mixed types now work | ||
1.1.21 / 2011-03-31 | ||
@@ -3,0 +8,0 @@ =================== |
@@ -284,3 +284,3 @@ | ||
exports.version = '1.1.21'; | ||
exports.version = '1.1.22'; | ||
@@ -287,0 +287,0 @@ /** |
@@ -39,3 +39,3 @@ | ||
Mixed.prototype.checkRequired = function (value) { | ||
Mixed.prototype.checkRequired = function (val) { | ||
return true; | ||
@@ -51,7 +51,10 @@ }; | ||
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; | ||
}; | ||
@@ -58,0 +61,0 @@ /** |
{ | ||
"name": "mongoose" | ||
, "description": "Mongoose MongoDB ORM" | ||
, "version": "1.1.21" | ||
, "version": "1.1.22" | ||
, "author": "Guillermo Rauch <guillermo@learnboost.com>" | ||
@@ -6,0 +6,0 @@ , "keywords": ["mongodb", "mongoose", "orm", "data", "datastore", "nosql"] |
@@ -6,4 +6,14 @@ | ||
var Query = require('mongoose/query'); | ||
var Query = require('mongoose/query') | ||
, start = require('./common') | ||
, mongoose = start.mongoose | ||
, DocumentObjectId = mongoose.Types.ObjectId | ||
, Schema = mongoose.Schema | ||
var Product = new Schema({ | ||
tags: {} // mixed | ||
}); | ||
mongoose.model('Product', Product); | ||
/** | ||
@@ -529,2 +539,14 @@ * Test. | ||
'test casting an array set to mixed type works': function () { | ||
var query = new Query(); | ||
var db = start(); | ||
var Product = db.model('Product'); | ||
var params = { _id: new DocumentObjectId, tags: { $in: [ 4, 8, 15, 16 ] }}; | ||
query.cast(Product, params); | ||
params.tags.$in.should.eql([4,8,15,16]); | ||
db.close(); | ||
}, | ||
// Advanced Query options | ||
@@ -531,0 +553,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3193389
217
26224