E11000 duplicate key error index in mongodb mongoose

前端 未结 25 2193
自闭症患者
自闭症患者 2020-11-22 05:49

Following is my user schema in user.js model -

var userSchema = new mongoose.Schema({
    local: {
        name: { type: String },
         


        
25条回答
  •  半阙折子戏
    2020-11-22 06:36

    If you are still in your development environment, I would drop the entire db and start over with your new schema.

    From the command line

    ➜ mongo
    use dbName;
    db.dropDatabase();
    exit
    

提交回复
热议问题