node-react-ecommerce icon indicating copy to clipboard operation
node-react-ecommerce copied to clipboard

E11000 duplicate key error

Open oyeyipo45 opened this issue 4 years ago • 4 comments

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)

oyeyipo45 avatar Jun 26 '20 18:06 oyeyipo45

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

aarya1906 avatar Aug 21 '20 07:08 aarya1906

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, [email protected] 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 .

oyeyipo45 avatar Aug 21 '20 11:08 oyeyipo45

Had the same error.

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

Ctrlanton avatar Aug 21 '20 13:08 Ctrlanton

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

Ctrlanton avatar Aug 21 '20 13:08 Ctrlanton