A NestJS module integrating Casbin with a MongoDB adapter for policy storage. Current stable version is 1.2.5, with no updates since 2021. It provides a ready-to-use module that configures Casbin with MongoDB as the policy backend, supporting model files and custom collections. Key differentiators include tight integration with NestJS dependency injection and a simple forRoot setup. Compared to alternatives like nestjs-casbin, this package specifically targets MongoDB users and avoids the need to manually configure adapters.
npm install nestjs-casbin-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up NestJS Casbin module with MongoDB adapter, including configuration parameters.
Use casbin v4.x and mongodb driver v3.x or pin versions in package.json.
Consider migrating to nestjs-casbin with a separate MongoDB adapter.
Always specify a unique 'collectionName' or ensure the default is acceptable.
Run 'npm install nestjs-casbin-mongodb @nestjs/common casbin mongodb' to include all peer deps.
Ensure MongoDB is running and the URI is correct, e.g., 'mongodb://localhost:27017/my-db'.