Open watch-janick opened 4 months ago
Hello!
Did anyone already used this plugin successfully with NestJS?
I'm following NestJS Mongoose documentation to add the plugin to my schema but it doesn't work.
In my module:
@Module({ imports: [ MongooseModule.forFeatureAsync([ { name: Passage.name, useFactory: () => { const schema = PassageSchema schema.plugin(require('mongoose-slug-updater')) return schema }, }, ]), ], controllers: [PassageController], providers: [PassageService], }) export class PassageModule {}
In my schema:
@Prop({ // required: true, unique: true, slug: ['field1', 'field2', 'field3'], }) slug: string
Every time I create an instance of it, it doesn't add the slug at all to the database and on the second occurrence I run into a duplicate error, so it looks like the plugin doesn't have any effect.
slug
Anyone figured it out?
Hello!
Did anyone already used this plugin successfully with NestJS?
I'm following NestJS Mongoose documentation to add the plugin to my schema but it doesn't work.
In my module:
In my schema:
Every time I create an instance of it, it doesn't add the
slug
at all to the database and on the second occurrence I run into a duplicate error, so it looks like the plugin doesn't have any effect.Anyone figured it out?