Following is my user
schema in user.js
model -
var userSchema = new mongoose.Schema({
local: {
name: { type: String },
I have also faced this issue and I solved it. This error shows that email is already present here. So you just need to remove this line from your Model for email attribute.
unique: true
This might be possible that even if it won't work. So just need to delete the collection from your MongoDB and restart your server.