E11000 duplicate key error index in mongodb mongoose

前端 未结 25 1566
自闭症患者
自闭症患者 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:39

    Had the same issue I resolved it by removing the unique attribute on the property.

    Just find another way to validate or check for unique property values for your schema.

    0 讨论(0)
提交回复
热议问题