之前的评论功能正常显示,现在回复这里做到一半不行了,不知道哪里user不能引入
C:\Users\fuchun bao\node_modules\mongoose\lib\connection.js:802
throw new MongooseError.MissingSchemaError(name);
^
MissingSchemaError: Schema hasn't been registered for model "user".
Use mongoose.model(name, schema)
at NativeConnection.Connection.model (C:\Users\fuchun bao\node_modules\m
ongoose\lib\connection.js:802:11)
at getModelsMapForPopulate (C:\Users\fuchun bao\node_modules\mongoose\li
b\model.js:3357:18)
at populate (C:\Users\fuchun bao\node_modules\mongoose\lib\model.js:2939
:15)
at _populate (C:\Users\fuchun bao\node_modules\mongoose\lib\model.js:290
7:5)
at Function.Model.populate (C:\Users\fuchun bao\node_modules\mongoose\li
b\model.js:2867:5)
at Immediate.cb (C:\Users\fuchun bao\node_modules\mongoose\lib\query.js:
1127:17)
at Immediate.<anonymous> (C:\Users\fuchun bao\node_modules\mquery\lib\ut
ils.js:137:16)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)
[nodemon] app crashed - waiting for file changes before starting...