A MongoDB database service for data persistence across the monorepo.
This service provides MongoDB database functionality and utilities for other services and applications in the monorepo.
- MongoDB connection management
- Data persistence layer
- Database utilities and helpers
- Query optimization
npm install
import { MongoService } from './mongo-service';
const mongoService = new MongoService();
await mongoService.connect();
Configure MongoDB connection settings in your environment:
MONGODB_URI=mongodb://localhost:27017
MONGODB_DATABASE=your_database
connect()
- Establish connection to MongoDBdisconnect()
- Close MongoDB connectionisConnected()
- Check connection status
create(collection, data)
- Create new documentsfind(collection, query)
- Find documentsupdate(collection, query, data)
- Update documentsdelete(collection, query)
- Delete documents
Copyright © 2022-2024 · LUXCIUM · (Benjamin Vincent Kasapoglu) · luxcium﹫neb401.com
† Scientia est lux principium✨ is a Trade Mark of Benjamin Vincent Kasapoglu