我正在使用我从github(https://github.com/mav-im/orientorm)下载的模块orientorm 我还在第23行之后在./lib/index.js中添加了代码行。
this.Scehma = require('./dbSchema');
this.Model = require('./model');
this.Query = require('./query');
这样我就可以使用其他模块了。我在谷歌搜索帮助。但是我找不到关于你模块的任何内容。
这是我的代码
orientorm = require('orientorm'),
orntSchema = orientorm.Scehma;
var UserScehma = new orntSchema({
created: {
type: Date,
default: Date.now
},
title: {
type: String,
required: true,
trim: true
},
content: {
type: String,
required: true,
trim: true
},
user: {
type: orntSchema.Types.Link,
ref: 'User'
}
});
orientorm.Model('UserScehma', UserScehma);
但我收到了这个错误......
.\lib\model\
this.$__.strictMode = schema.builtOpts && schema.builtOpts.strict;
^
TypeError: Cannot read property 'builtOpts' of undefined
at Orientorm.Doc (D:\orientrom_app_prec_1\node_modules\orientorm\lib\model\Document.js:35:33)
at Orientorm.Model (D:\orientrom_app_prec_1\node_modules\orientorm\lib\model\index.js:13:7)
at Object.<anonymous> (D:\orientrom_app_prec_1\app.js:27:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3