Comparing version 1.0.6 to 1.0.7
@@ -57,2 +57,3 @@ | ||
function slugGenerator (options){ | ||
options = options || {}; | ||
var key = options.key || 'title'; | ||
@@ -68,3 +69,3 @@ | ||
BlogPost.use(slugGenerator()); | ||
BlogPost.plugin(slugGenerator()); | ||
@@ -75,2 +76,2 @@ /** | ||
Mongoose.model('BlogPost', BlogPost); | ||
mongoose.model('BlogPost', BlogPost); |
1.0.7 / 2011-02-05 | ||
================== | ||
* Fixed memory leak warnings for test suite on 0.3 | ||
* Fixed querying documents that have an array that contain at least one | ||
specified member. [brian] | ||
* Fixed default value for Array types (fixes GH-210). [brian] | ||
* Fixed example code. | ||
1.0.6 / 2011-02-03 | ||
@@ -3,0 +12,0 @@ ================== |
@@ -13,4 +13,2 @@ | ||
this.conn = conn; | ||
this.conn.on('open', this.onOpen.bind(this)); | ||
this.conn.on('close', this.onClose.bind(this)); | ||
if (this.conn.readyState == 1) this.onOpen(); | ||
@@ -17,0 +15,0 @@ this.queue = []; |
@@ -141,2 +141,8 @@ | ||
this.readyState = 1; | ||
// avoid having the collection subscribe to our event emitter | ||
// to prevent 0.3 warning | ||
for (var i in this.collections) | ||
this.collections[i].onOpen(); | ||
this.emit('open'); | ||
@@ -197,2 +203,8 @@ }; | ||
this.readyState = 0; | ||
// avoid having the collection subscribe to our event emitter | ||
// to prevent 0.3 warning | ||
for (var i in this.collections) | ||
this.collections[i].onClose(); | ||
this.emit('close'); | ||
@@ -199,0 +211,0 @@ }; |
@@ -191,3 +191,3 @@ | ||
this.set(path[i], prefix + i); | ||
} else { | ||
} else if ('undefined' !== typeof path[i]) { | ||
this.set(prefix + i, path[i]); | ||
@@ -194,0 +194,0 @@ } |
@@ -256,3 +256,3 @@ | ||
exports.version = '1.0.6'; | ||
exports.version = '1.0.7'; | ||
@@ -259,0 +259,0 @@ /** |
@@ -7,2 +7,3 @@ | ||
var Document = require('./document') | ||
, MongooseArray = require('./types/array') | ||
, DocumentArray = require('./types/documentarray') | ||
@@ -423,3 +424,3 @@ , MongooseError = require('./error') | ||
if (query[i] === null || query[i] === undefined) | ||
ret[i] = query[i] | ||
ret[i] = query[i]; | ||
else if (query[i].constructor == Object) { | ||
@@ -442,7 +443,17 @@ ret[i] = query[i]; | ||
ret[i][key] = ret[i][key].valueOf(); | ||
}); | ||
} else if (query[i].constructor == RegExp || Array.isArray(query[i])) | ||
ret[i] = query[i]; | ||
else | ||
else { | ||
ret[i] = this.schema.path(i).cast(query[i]); | ||
// Take care of special case of MongooseArray for checking 1 element membership | ||
if (ret[i] instanceof MongooseArray) { | ||
var arr = ret[i]; | ||
delete ret[i]; | ||
ret[i] = { | ||
$all: arr | ||
}; | ||
} | ||
} | ||
} | ||
@@ -449,0 +460,0 @@ |
@@ -32,6 +32,8 @@ /** | ||
var self = this; | ||
var self = this | ||
, defaultArr; | ||
if (this.defaultValue) defaultArr = this.defaultValue; | ||
this.default(function(){ | ||
return new MongooseArray([], self.path, this); | ||
return new MongooseArray(defaultArr || [], self.path, this); | ||
}); | ||
@@ -38,0 +40,0 @@ }; |
@@ -46,5 +46,7 @@ | ||
SchemaType.prototype.default = function (val) { | ||
if (arguments.length){ | ||
if (arguments.length === 1){ | ||
this.defaultValue = val; | ||
return this; | ||
} else if (arguments.length > 1) { | ||
this.defaultValue = [].slice.call(arguments); | ||
} | ||
@@ -51,0 +53,0 @@ return this.defaultValue; |
{ | ||
"name": "mongoose" | ||
, "description": "Mongoose MongoDB ORM" | ||
, "version": "1.0.6" | ||
, "version": "1.0.7" | ||
, "author": "Guillermo Rauch <guillermo@learnboost.com>" | ||
@@ -6,0 +6,0 @@ , "keywords": ["mongodb", "mongoose", "orm", "data", "datastore", "nosql"] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
1661360
28631