qqilihq / mongoose-slugger

Mongoose plugin to automatically generate so called slugs (atomically)
MIT License
3 stars 6 forks source link

(Error Code 11000) How to create slug with exists documents #32

Closed KatonyVN closed 2 years ago

KatonyVN commented 2 years ago

Hello friends! I am facing a problem when using with Typegoose, I am trying to allow users to create the same documents, but when using this plugin, I am getting error code 11000 when creating the document I am creating already existed before. Here is my code, if I'm wrong please help me Model.ts image

Error message: image

Thank all!

qqilihq commented 2 years ago
  1. Generally, the title should not be in the unique index, the slug would be sufficient.

  2. If this does not help, please provide a test case here (without Typegoose, just plain Mongoose)