Skip to content

Mongoose plugin to name collections based on naming convention camelCase, snake_case, PascalCase, ...etc

License

Notifications You must be signed in to change notification settings

muhammedkamel/mongoose-collection-naming-plugin

Repository files navigation

Mongoose Collection Naming Plugin

A Mongoose plugin that enforces a standard naming convention for all MongoDB collections.


CI releases

Description

A Mongoose plugin that enforces a standard naming convention (e.g., CamelCase, SnakeCase) for collections while allowing flexibility for custom names outside the convention.

Installation

npm

npm i mongoose-collection-naming-plugin

pnpm

pnpm add mongoose-collection-naming-plugin

Usage

Typescript

import {
  MongooseCollectionNamingPlugin,
  NamingConvention,
} from 'mongoose-collection-naming-plugin';

mongoose.plugin(
  MongooseCollectionNamingPlugin, 
  { namingConvention: NamingConvention.CamelCase }
);

Javascript

const {
  MongooseCollectionNamingPlugin,
  NamingConvention,
} = require('mongoose-collection-naming-plugin');

mongoose.plugin(
  MongooseCollectionNamingPlugin, 
  { namingConvention: NamingConvention.SnakeCase }
);

About

Mongoose plugin to name collections based on naming convention camelCase, snake_case, PascalCase, ...etc

Resources

License

Stars

Watchers

Forks

Packages

No packages published