A TypeScript queue implementation backed by MongoDB, built from mongodb-queue. Current version 1.5.1 wraps MongoDB Node driver v6 and supports MongoDB 7. Offers delayed messages, visibility timeout (default 30s), max retries, dead-letter queue, and configurable recursion limit via environment variable. Designed for Node.js and TypeScript projects needing a simple, persistent message queue without additional infrastructure. Release cadence: as needed; last update February 2024.
npm install ts-mongo-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows connecting to MongoDB, creating a queue, adding a message, getting it, and acknowledging removal.
Use MongoQueue(client, name, opts) without 'new'.
Ensure your processing completes within visibility timeout or call requeue to defer.
Always pass name as second argument: MongoQueue(client, 'myqueue').
Consider setting a TTL index on the 'createdAt' field in your MongoDB collection, or use a capped collection.
Change to: const queue = MongoQueue(client, 'queueName');
Run: npm install mongodb
Let the library generate _id automatically by omitting it from payload.