我试图将架构嵌入到我创建的其他架构中,并且不断出现此错误:
我不完全确定这里出了什么问题,但是我想做的是在用户模式中存储对我的事件模式和兴趣模式的引用。如果有人可以告诉我我在做什么错,那将非常感谢!
编辑:我现在收到一个新的错误:
/Users/Dynee/node_modules/mongoose/lib/schema.js:421
throw new TypeError('Invalid value for schema Array path `' + prefix + key + '`');
^
TypeError: Invalid value for schema Array path `eventsHosted`
at Schema.add (/Users/Dynee/node_modules/mongoose/lib/schema.js:421:13)
at new Schema (/Users/Dynee/node_modules/mongoose/lib/schema.js:99:10)
at Object.<anonymous> (/Users/Dynee/Documents/eventure-rest-backend/Models/User.js:5:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/Dynee/Documents/eventure-rest-backend/Models/Event.js:2:43)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Run Code Online (Sandbox Code Playgroud)
我的用户架构
var mongoose …Run Code Online (Sandbox Code Playgroud)