StephenGrider / FullstackReactCode

Companion repo to https://www.udemy.com/node-with-react-fullstack-web-development
1.39k stars 1.17k forks source link

Error when saving the second user in database #68

Closed john012343210 closed 4 years ago

john012343210 commented 4 years ago
UnhandledPromiseRejectionWarning: MongoError: E11000 duplicate key error collection: test.users index: email_1 dup key:
{ email: null }

saving the first user is never a problem, but saving the second seems to lead to token: Bad request. What is strange is that we never attempt to save the email of the user right?

john012343210 commented 4 years ago

turns out that there is an index name "email1" undeleted.