I am receiving the following error within Mongoose.js. It doesn't happen all the time, just sometimes.
TypeError: this.isSelected is not a function
at model.Model.$__version (/app/node_modules/mongoose/lib/model.js:589:13)
at model.Model.$__delta (/app/node_modules/mongoose/lib/model.js:511:10)
at model.Model.$__handleSave (/app/node_modules/mongoose/lib/model.js:147:22)
at model.Model.$__save (/app/node_modules/mongoose/lib/model.js:185:9)
at model.Model.save (/app/node_modules/mongoose/lib/model.js:283:15)
at model._done (/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:101:24)
at _next (/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:64:28)
at fnWrapper (/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:186:8)
at model.Object.defineProperty.value.fn (/app/node_modules/mongoose/lib/schema.js:221:11)
at _next (/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:62:30)
at fnWrapper (/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:186:8)
at /app/node_modules/mongoose/lib/schema.js:196:17
at /app/node_modules/mongoose/node_modules/kareem/index.js:127:16
at wrapped (/app/node_modules/newrelic/lib/transaction/tracer/index.js:161:28)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickDomainCallback [as _tickCallback] (node.js:390:13)
The relevant code that I believe is producing that error is as follows:
exports.updateTheme = function(req, res) {
var theme = req.theme;
delete req.body.created;
delete req.body.modified;
delete req.body.user;
delete req.body._id;
theme.modified = new Date().getTime();
theme = _.extend(theme, req.body);
theme.markModified('copyMinNumericalAttsColorNodes');
theme.markModified('copyMaxNumericalAttsColorNodes');
theme.save(function(err, theme) {
if(err) {
console.log(err);
res.status(500).send(err);
} else {
res.json(theme);
}
});
};
I would really appreciate any thoughts on what could be producing this error. Thanks!
via Andrew
No comments:
Post a Comment