slugify-mongoose
Generate a unique slug for mongoose.
Installation
npm i --save slugify-mongoose
Usage
const slugify =const mongoose =const Schema = mongooseSchemaconst mySchema =title: type: Stringslug: type: String slug: 'title' unique: truemySchema
Info
There are currently a lot of plugins for mongoose that already generate slugs, I made this because none of them worked with the web framework feathers.
This plugin also works with keystone.