{"id":43416,"library":"nestjs-rest-mongodb","title":"nestjs-rest-mongodb","description":"A MongoDB adapter for nestjs-rest, providing a CRUD service for JSON:API compliant applications built with NestJS and MongoDB. Current stable version is 1.0.1, released on npm with monthly updates. Supports both offset and cursor pagination. Requires Node >=20 and MongoDB >=6. Key differentiator: integrates seamlessly with nestjs-rest to provide a standardized JSON:API data layer for MongoDB.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/ziv/nestjs-rest","tags":["javascript","nestjs","rest","crud","resource","controller","api","mongodb","mongo","typescript"],"install":[{"cmd":"npm install nestjs-rest-mongodb","lang":"bash","label":"npm"},{"cmd":"yarn add nestjs-rest-mongodb","lang":"bash","label":"yarn"},{"cmd":"pnpm add nestjs-rest-mongodb","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; core framework adapter","package":"nestjs-rest","optional":false},{"reason":"peer dependency; JSON:API serialization","package":"std-json-api","optional":false},{"reason":"peer dependency; MongoDB driver v6+","package":"mongodb","optional":false}],"imports":[{"note":"ESM-only package; use named import.","wrong":"const MongoService = require('nestjs-rest-mongodb')","symbol":"MongoService","correct":"import { MongoService } from 'nestjs-rest-mongodb'"},{"note":"No default export; use named import.","wrong":"import MongoModule from 'nestjs-rest-mongodb'","symbol":"MongoModule","correct":"import { MongoModule } from 'nestjs-rest-mongodb'"},{"note":"TypeScript types included.","wrong":null,"symbol":"MongoRepository","correct":"import { MongoRepository } from 'nestjs-rest-mongodb'"}],"quickstart":{"code":"import { Module } from '@nestjs/common';\nimport { MongoModule } from 'nestjs-rest-mongodb';\nimport { MongoClient } from 'mongodb';\n\n@Module({\n  imports: [\n    MongoModule.forRoot({\n      client: new MongoClient(process.env.MONGO_URI ?? 'mongodb://localhost:27017'),\n      databaseName: 'mydb',\n    }),\n  ],\n})\nexport class AppModule {}","lang":"typescript","description":"Registers the MongoModule with a MongoDB client and database name for NestJS CRUD operations."},"warnings":[{"fix":"Upgrade Node to version 20 or higher.","message":"Requires Node >=20.0.0","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Install mongodb@^6.0.0.","message":"MongoDB driver version must be >=6.0.0","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use MongoModule.forRoot() instead.","message":"Old API using ClassSerializerInterceptor is no longer supported","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use import { MongoService } from 'nestjs-rest-mongodb'.","message":"Import must be named, not default","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update npm to version 10 or higher.","message":"npm engines field enforces npm >=10","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.1':30 '20':45 '6':48 'adapt':7 'api':18,62,73 'applic':20 'built':21 'compliant':19 'control':72 'crud':14,70 'current':26 'cursor':41 'data':63 'differenti':50 'integr':51 'javascript':67 'json':17,61 'key':49 'layer':64 'mongo':75 'mongodb':4,6,25,47,66,74 'month':35 'nestj':2,10,23,55,68 'nestjs-rest':9,54 'nestjs-rest-mongodb':1 'node':44 'npm':33 'offset':39 'pagin':42 'provid':12,58 'releas':31 'requir':43 'resourc':71 'rest':3,11,56,69 'seamless':52 'servic':15 'stabl':27 'standard':60 'support':37 'typescript':76 'updat':36 'version':28","created_at":"2026-06-05T16:59:41.900117+00:00","updated_at":"2026-06-05T16:59:41.900117+00:00","problems":[{"fix":"Run `npm install nestjs-rest-mongodb nestjs-rest std-json-api mongodb`.","cause":"Package not installed or missing peer dependencies.","error":"Cannot find module 'nestjs-rest-mongodb'"},{"fix":"Use import { MongoModule } from 'nestjs-rest-mongodb'.","cause":"Incorrect import due to missing curly braces (default import used).","error":"MongoModule is not a function"},{"fix":"Ensure MongoClient.connect() is called before creating module.","cause":"Client passed to forRoot is not connected.","error":"MongoClient must be connected before passing to MongoModule"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/ziv/nestjs-rest#readme","github":"https://github.com/ziv/nestjs-rest","docs":null,"changelog":null,"pypi":null,"npm":"nestjs-rest-mongodb","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}