我在下面的代码中添加'content Binary Data
下面的那一刻我收到以下错误。我缺少什么
代码
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var MeterdataSchema = new Schema({
serialno: String,
info: String,
active: Boolean,
content: "Binary Data"
});
module.exports = mongoose.model('Meterdata', MeterdataSchema);
错误
>> Waiting for server reload...
D:\Users\rohanindotech\Developer\yoangfull2\node_modules\mongoose\lib\schema.js:
362
throw new TypeError('Undefined type at `' + path +
^
TypeError: Undefined type at `content`
Did you try nesting Schemas? You can only nest using refs or arrays.
at Function.Schema.interpretAsType (D:\Users\rohanindotech\Developer\yoangfu
ll2\node_modules\mongoose\lib\schema.js:362:11)
at Schema.path (D:\Users\rohanindotech\Developer\yoangfull2\node_modules\mon
goose\lib\schema.js:305:29)
at Schema.add (D:\Users\rohanindotech\Developer\yoangfull2\node_modules\mong
oose\lib\schema.js:217:12)
at new Schema (D:\Users\rohanindotech\Developer\yoangfull2\node_modules\mong
oose\lib\schema.js:73:10)
at Object.<anonymous> (D:\Users\rohanindotech\Developer\yoangfull2\server\ap
i\meterdata\meterdata.model.js:6:23)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
Done waiting!