A MongoDB connection plugin for the Meadow data access layer that integrates with the Fable dependency injection framework, providing connection pooling, automatic collection creation and index management, and authentication support. Version 1.0.3, released under MIT license. It accepts both Meadow-style and native MongoDB configuration properties and supports auto-connect mode. Releases are infrequent and tied to the Retold framework ecosystem.
npm install meadow-connection-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to instantiate Fable, add the MongoDB service, and connect asynchronously.
Place your MongoDB configuration inside the 'MongoDB' property of the Fable settings object.
Use callback pattern or promisify with util.promisify() for async/await.
Use require() instead of import. If using TypeScript, set 'esModuleInterop': false.
Do not call connect() multiple times; call disconnect() if reconnecting is needed.
Use 'pool' directly for database operations; it is the MongoDB Db object.
Rely on createTable() to handle indexes; avoid creating indexes manually on those fields.
Ensure connectAsync callback is invoked before using pool getter.
Check the User and Password settings in the MongoDB config; add an 'authSource' property if needed.
Use 'const libMeadowConnectionMongoDB = require('meadow-connection-mongodb');'.Run 'npm install meadow-connection-mongodb' and ensure the require path is correct.
Ensure Fable is installed (npm install fable) and instantiated as shown in quickstart.