UnhandledPromiseRejectionWarning: MongoError: E11000 duplicate key error collection: blog.users index: email_1 dup key: { email: “[email protected]” } An error is reported
because the mailbox I set cannot be duplicated with the mailbox number in the database, so I put it in the database When inserting data with the same mailbox number, the above error will occur!
Solution: Insert after changing the mailbox number, or delete the data in the database, or remove unique.