A lightweight, reliable message queue library built on top of MongoDB. The current stable version is 4.0.0, compatible with MongoDB v3 driver. It provides a simple API for adding, getting, acking, and pinging messages, with options for visibility timeout and delay. It is feature-complete and stable, with minimal ongoing development. Key differentiators include zero external dependencies beyond MongoDB, persistent storage, and built-in message visibility management. Ideal for Node.js applications already using MongoDB that need a simple, durable queue without additional infrastructure. Note: For MongoDB v2 driver, use mongodb-queue@3.
npm install mongodb-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows adding, getting, and acknowledging a message using mongodb-queue with async/await and proper error handling.
Upgrade to mongodb driver v3 or later. If using v2, use mongodb-queue@3.
Wrap callbacks in Promises or use utility like 'util.promisify'.
Create only one queue instance per collection and reuse it.
Call queue.clean() periodically or after processing to remove acked messages if desired.
Ensure you access the id via (err, id) not (id).
Remove 'new': const queue = mongoDbQueue(db, 'name');
Ensure all queue operations complete before closing the client.
Always check if msg is not null before accessing its properties.
No dependency data recorded yet.