MissingSchemaError: Schema hasn't been registered for model “User”

前端 未结 16 1109
别跟我提以往
别跟我提以往 2020-12-02 16:56

In my models/user.js file:

var mongoose = require(\'mongoose\');
var Schema = mongoose.Schema;

var userSchema = new Schema({
    (define schema         


        
16条回答
  •  臣服心动
    2020-12-02 17:13

    I tried all the above solutions but all of them failed instead I found that the solution was to clear my database (MongoDB) and then rerunning the app

提交回复
热议问题