A Mongoose plugin that enforces a standard naming convention for all MongoDB collections.
A Mongoose plugin that enforces a standard naming convention (e.g., CamelCase, SnakeCase) for collections while allowing flexibility for custom names outside the convention.
npm i mongoose-collection-naming-plugin
pnpm add mongoose-collection-naming-plugin
import {
MongooseCollectionNamingPlugin,
NamingConvention,
} from 'mongoose-collection-naming-plugin';
mongoose.plugin(
MongooseCollectionNamingPlugin,
{ namingConvention: NamingConvention.CamelCase }
);
const {
MongooseCollectionNamingPlugin,
NamingConvention,
} = require('mongoose-collection-naming-plugin');
mongoose.plugin(
MongooseCollectionNamingPlugin,
{ namingConvention: NamingConvention.SnakeCase }
);