MongoError,err:E11000 duplicate key error

前端 未结 5 851
抹茶落季
抹茶落季 2020-12-28 15:40

I have a MongoDb schema like this

    var User = new Schema({
    \"UserName\": { type: String, required: true },
    \"Email\": { type: String, required: tr         


        
5条回答
  •  我在风中等你
    2020-12-28 16:08

    The reason behind this error is that,The index is not present or different in your collection, in which you are trying insert. So Solution is to drop that collection and run your program again.

提交回复
热议问题