MongoDB-based message queue emitter implementing the MQEmitter interface. Version 9.1.0, released regularly. It persists messages in MongoDB, supporting topics and payloads. Differentiators: leverages MongoDB for persistence and scaling, suitable for Node.js applications needing durable pub/sub messaging. Requires Node.js >=20.0.0. The package provides a simple API for emitting and subscribing to messages with an optional callback pattern.
npm install mqemitter-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a MongoDB-backed MQEmitter, subscribes to a topic, and emits a message with a callback.
Ensure cb() is called without arguments (no error).
Use modern MongoDB connection options instead of query parameters for auto reconnect.
Use connection error events or global error handlers to catch MongoDB errors.
Upgrade Node.js to >=20.0.0.
Use `import mqemitter from 'mqemitter-mongodb'` instead of `import { mqemitter } from 'mqemitter-mongodb'`Ensure the MongoDB URL contains valid credentials, e.g., 'mongodb://user:pass@host/db'
Include a 'topic' string property in the message object, e.g., { topic: 'test', payload: 'data' }Provide a valid MongoDB connection string via the `url` option