Express+Mongoose - unique option not working

Hello :wave: @Nir_Gluzman,

Welcome to the MongoDB Community forums :sparkles:

I tested your Git repository code base, and it worked perfectly fine for me. I received the following error in Postman when I tried to insert a document with the same email ID:

{ "error": "E11000 duplicate key error collection: test.blogs index: email_1 dup key: { email: \"mike@gmail.com\" }" }

To better understand the issue, could you share the workflow you followed to insert the document in MongoDB?

Could you please elaborate on what you meant by the above statement?

Best,
Kushagra