mongoose-slug-unique
a simple mongoose plugin that populates a Mongoose Schema with .slug
wich is unique, from one or more existing properties, when the given prop
is set.
installation
$ npm install mongoose-slug-unique
Usage
var slug = ; schema;var Song = mongoose; var song = ;songname = 'frank ab';songslug; // > frank-ab
To use different slug candidates pass them as array
var slug = ; schema;var Person = mongoose; var person = firstName: 'John' lastName: 'Doe'; person;
License
MIT