-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate unique slug based on the field combination #43
Comments
What happens when you disable unique index? Theoretically it should work. Maybe the index already exists and this plugin won't delete it. Perhaps allowing users to plugin the |
Changing the value of
The incremental suffix on the slug won't work anymore when I disable the unique on the index. As I mention before
I think allowing users to plugin the ArticleSchema.plugin(URLSlugs('title', {scope: ['author']]})); I'll try to tweak the code a bit, are you open for a pull request? |
sure |
Hi, I'm trying to generate slug for a document based on the combination with other field (a reference field). The slug will still be generated based on the title field of the document, but the other field will be involved in the uniqueness of the slug. So it's kind of composite since it involving other field to the uniqueness factor. Here is an example of what I'm trying to achieve.
Person Schema
Article Schema
Person Collection
Article Collection
What I'm trying to achieve here is to have slug for the article name that is only unique to the author field. So, duplicate slug will still be allowed in the collection but it is still have to be strictly unique prior to the author.
Route example
The similar issue was already been mentioned here #12 before, and you suggest to set the
IndexUnique
to befalse
to allow duplication but still doesn't resolve the case that I got here.Thanks 😄
The text was updated successfully, but these errors were encountered: