A MongoDB library for NestJS applications built on top of Mongoose. Version 4.1.3. Designed to simplify common MongoDB operations within NestJS projects. Differentiates by providing a thin wrapper around Mongoose with NestJS-specific patterns, but has minimal documentation.
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ESM-only must use import syntax
import { MongoModule } from 'finup-mongo-library'
Named export, not default
import { MongoService } from 'finup-mongo-library'
Type export for configuration
import { MongoModuleOptions } from 'finup-mongo-library'
Sets up MongoModule with connection URI and injects MongoService to access the database instance.
import { Module } from '@nestjs/common';
import { MongoModule } from 'finup-mongo-library';
@Module({
imports: [
MongoModule.forRoot({
uri: process.env.MONGO_URI ?? 'mongodb://localhost:27017/mydb',
}),
],
})
export class AppModule {}
import { Injectable } from '@nestjs/common';
import { MongoService } from 'finup-mongo-library';
@Injectable()
export class MyService {
constructor(private readonly mongoService: MongoService) {}
async getData() {
const db = await this.mongoService.getDatabase();
return db.collection('test').find().toArray();
}
}
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.