Following is my user
schema in user.js
model -
var userSchema = new mongoose.Schema({
local: {
name: { type: String },
It's not a big issue but beginner level developers as like me, we things what kind of error is this and finally we weast huge time for solve it.
Actually if you delete the db and create the db once again and after try to create the collection then it's will be work properly.
➜ mongo
use dbName;
db.dropDatabase();
exit