A systemic component for MongoDB that integrates with the systemic dependency injection framework. Current stable version is 2.1.0. It wraps the native MongoDB driver to provide a configurable, lifecycle-managed MongoDB client within a systemic application. Release cadence is low, with updates driven by MongoDB driver changes. Key differentiator: it handles connection lifecycle (connect/disconnect) and exposes a configured MongoClient instance as a systemic component, simplifying dependency injection setups. It supports connection string, options, and logging configuration.
npm install systemic-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure and use the systemic-mongodb component with a MongoDB connection, including error handling and basic collection query.
Access the MongoDB client via components.mongodb, then call client.db('dbname').Use .add('mongodb', mongodb()).dependsOn(...) instead of .add('mongodb', mongodb).Refer to MongoDB Node.js driver v3+ documentation for correct options structure.
Keep showConnectionString: false in production to avoid leaking credentials.
Use const mongodb = require('systemic-mongodb'); and then call mongodb()Ensure 'config' and 'logger' dependencies are added before 'mongodb' and that 'config.mongodb' has the required 'url' property.
Verify MongoDB server is running and the URL is correct (e.g., mongodb://127.0.0.1:27017/example).