0
Mongoose.js内で次のエラーが発生しています。いつも起こるわけではありません。私は本当にこのエラーを生成することができるもの上の任意の考えをいただければ幸いですthis.isSelectedはMongoose.jsの関数エラーではありません
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);
}
});
};
次のように私はそのエラーを生成していると信じて
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)
関連するコードです。ありがとう!以下にコードを変更する