basir / node-react-ecommerce

Build ECommerce Website Like Amazon By React & Node & MongoDB
https://node-react-ecommerce-app.herokuapp.com/
1.69k stars 793 forks source link

E11000 duplicate key error #69

Open oyeyipo45 opened 4 years ago

oyeyipo45 commented 4 years ago

Trying to add a new user and I'm getting this error even after adding {dropDups: true} to the to the userSchema. TIME IN PROJECT: 3:21:21, Thank you very much

Screenshot (51)

aarya1906 commented 4 years ago

did your problem is solved? If solved,kindly help me with the same

oyeyipo45 commented 4 years ago

No it didn't get solved, I just left it since there is only going to be one admin, please if you ever find a solution please let me know.

On Fri, 21 Aug 2020, 08:53 JAMES PORTER, notifications@github.com wrote:

did your problem is solved? If solved,kindly help me with the same

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/basir/node-react-ecommerce/issues/69#issuecomment-678100188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMIQPJ6CHOS4AGR4JVYETYLSBYRY7ANCNFSM4OJRQVTA .

Ctrlanton commented 4 years ago

Had the same error.

Check your mongoDB users collection through Terminal and delete if you have multiple users there.

Ctrlanton commented 4 years ago

Everytime you update your localhost:5000/api/users/createadmin it will add a new admin user to your collection