Following is my user schema in user.js model -
user
user.js
var userSchema = new mongoose.Schema({ local: { name: { type: String },
Check collection indexes.
I had that issue due to outdated indexes in collection for fields, which should be stored by different new path.
Mongoose adds index, when you specify field as unique.