I have a schema like this:
@Schema()
export class Pais extends Document {
@Prop(
raw({
codigo: { type: String, index: true, unique: true },
}),
)
@Prop()
descripcion: string;
}
export const PaisSchema = SchemaFactory.createForClass(Pais);
PaisSchema.plugin(uniqueValidator, { message: `{PATH} debe ser único` });
By default nest.js add an 's' to the class name, so it would be 'paiss' for the collection, but I want the name to be 'paises'.
On the module I tried this:
@Module({
imports: [
MongooseModule.forFeature([{ name: 'paises', schema: PaisSchema }]),
],
but it didn't work. How can I solve this problem?