mongoose-slug
a simple mongoose plugin that populates .slug
when the given prop
is set.
installation
$ npm install mongoose-slug
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