0
로 인해 저장할 수 없습니다 :몽구스 지원 엔티티가 나는 몽구스 지원 모델의 인스턴스를 절약에 도움이 필요 (신비) "decodeInt"/ VirtualType/게터 오류
node.js:134
00:27:16 web.1 | throw e; // process.nextTick error, or 'error' event on first tick
00:27:16 web.1 | ^
00:27:16 web.1 | TypeError: Cannot call method 'decodeInt' of undefined
00:27:16 web.1 | at model.<anonymous> (.../node_modules/mongoose-types/lib/plugins/useTimestamps.js:13:37)
00:27:16 web.1 | at VirtualType.applyGetters (.../node_modules/mongoose/lib/virtualtype.js:53:25)
00:27:16 web.1 | at model.get (...
: 엔티티를 저장하면 다음과 같은 오류가 발생합니다
var instance = new TextSnippet();
instance.text= req.query["text"];
instance.context= req.query["ctx"];
instance.url = req.query["url"];
instance.position= "";
console.log(JSON.stringify(instance));
instance.save(function (err) {
console.log(err);
});
: 모델 정의는 & 새로운 엔티티는 다음과 같다 저장 작성하는 코드
var mongooseTypes = require("mongoose-types"), useTimestamps = mongooseTypes.useTimestamps;
mongooseTypes.loadTypes(mongoose);
var Url = mongoose.SchemaTypes.Url;
var Schema = mongoose.Schema
, ObjectId = Schema.ObjectId;
var TextSnippetSchema = new mongoose.Schema({
text_id : ObjectId
, text : String
, context : String
, url : Url
, position : String
});
TextSnippetSchema.plugin(useTimestamps);
var TextSnippet = mongoose.model('TextSnippet',TextSnippetSchema);
입니다
제 이해에는 "decodeInt"가 필요한 자산이 없습니다. 그러나 엔터티를 저장할 수 없습니다.
나를 위해 개체 지속성 작업을 도와 주시겠습니까?
고마워,이 수정 프로그램은 나를 위해 작동합니다. 패치를 소유자에게 제출 했습니까? –
나는 여러 다른 사람들과 함께 해결할 시간이있다. – speajus