Hello, I've been facing with an issue when I try to save documents which uses mongoose-slug-plugin.
I've set alwaysUpdateSlug
options to false to avoid slug check on each save(), but it keeps trying to check the slug.
Here is my plugin settings:
ShopSchema.plugin(mongooseSlugPlugin, { tmpl: "<%=name.en%>", alwaysUpdateSlug: false });
Here is the log:
Error: The
str argument was missing at getUniqueSlug (/app/node_modules/mongoose-slug-plugin/index.js:8:29)
I guess it's because I select fields when I get document from its collections and I don't select slug
field because I don't need it. But plugin tries to check the slug field which is null at this point.
How can I disable this plugin for doc.save() functions? Or is there a way to bypass it where I don't want this plugin to check document?