{"_id":"mongodb-queue-up","_rev":"8-db3cd99483db592a0d3af00ccd0f55c7","name":"mongodb-queue-up","dist-tags":{"latest":"5.5.0"},"versions":{"5.0.0":{"name":"mongodb-queue-up","version":"5.0.0","keywords":["mongodb","queue"],"license":"MIT","_id":"mongodb-queue-up@5.0.0","maintainers":[{"name":"mhassan1","email":"marc.j.hassan@gmail.com"}],"homepage":"https://github.com/mhassan1/mongodb-queue-up","bugs":{"url":"https://github.com/mhassan1/mongodb-queue-up/issues"},"dist":{"shasum":"2249979839d2fcfb9608c925b4135c3bf9ab6702","tarball":"https://registry.npmjs.org/mongodb-queue-up/-/mongodb-queue-up-5.0.0.tgz","fileCount":4,"integrity":"sha512-4itzVMzNFD0Zszx46wuXg+f33eZxHoJXKDZeZIgCGmmOZn9HFBnC9McwbKZglEUJ8lRQBIsH8t8RJfmj1jgaaw==","signatures":[{"sig":"MEQCIHJi+3nUnPnJW/HAB2g/gGqUQUOnKBnAot3as63FM7fzAiA0iAJPboczE8Kdw4/zvzBgKqLK1vCqx4PbLfGgDanaBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJh8KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrgNQ/7BcVaoleMOPW+ct1v2CdAwKIxGRzE3NMNVFTDUywfxWNZY2jJ\r\nC4mK/O+Hj+rugIWKEyyqKEr87kD8Zlx2KLMrb8zA+jFvyOusgcgbISVTZvp9\r\nlOgcvdIYTit36rtauEGZUIZdrLC1yrZ0RPXuDW5aVYAa6hlG1bl3SrNAl5rZ\r\nUVzDxzQ+1a+9u+VUSLQNbSJoW6/uRrxKG9/S8oOSJjtIYXufuWiXLiOjsmTa\r\nDJSkm/n8bGJB7kNumb1H2nSIJq16liNY6ooHL31yBS1xQRl4818gnFOo8/FC\r\nNwmQNBPxUtAkd4hgRf2oCnCx9Ge0KVd/VtssDSU9NQYkUKg7xE+MLjZJJcWo\r\nCURNTy7Me9ErR7W+BJ1/ICckWC1gOy5L6xefzCilH3MYMOglnokmeXIR/6wh\r\n6jLK8pufnA+yi7U1J5vX/S1GjLy0LXCD/Qhi+GmGvqvg/o3S2BsCgffUn9t/\r\n3NYtG/HhPTfxbUdTEiXA2IMq47uTgSTjRFZ9TUp1Hnld0g274myqMn6QaIIu\r\nPNd8Npo2PFrBkBQbQQcrC00xlfpG+M7s9zchzsZVlvhQS8lB9iEEactKJdGg\r\n6yTMbSgydEv6pzfTY2knkdLg93xqkXyC7VVNJXE/jIqUeoR5p5+JSUM6OMx9\r\nWmxS5cZHgSzHQSAWfyzsBdaXUrN+Qofu7cE=\r\n=ShT2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"mongodb-queue.js","types":"mongodb-queue.d.ts","gitHead":"1a7f751a6643657127e5bf3f535e69bd9c13aa69","scripts":{"test":"set -e; for FILE in test/*.js; do echo --- $FILE ---; node $FILE; done"},"_npmUser":{"name":"mhassan1","email":"marc.j.hassan@gmail.com"},"repository":{"url":"git://github.com/mhassan1/mongodb-queue-up.git","type":"git"},"_npmVersion":"8.3.1","description":"Message queues which uses MongoDB.","directories":{},"_nodeVersion":"16.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.10.1","async":"^2.6.2","mongodb":"^4.4.1"},"peerDependencies":{"mongodb":"^4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-queue-up_5.0.0_1646665482460_0.33086716662267524","host":"s3://npm-registry-packages"}},"5.0.1":{"name":"mongodb-queue-up","version":"5.0.1","keywords":["mongodb","queue"],"license":"MIT","_id":"mongodb-queue-up@5.0.1","maintainers":[{"name":"mhassan1","email":"marc.j.hassan@gmail.com"}],"homepage":"https://github.com/mhassan1/mongodb-queue-up","bugs":{"url":"https://github.com/mhassan1/mongodb-queue-up/issues"},"dist":{"shasum":"8821f088a45104e6b0a4f7d3e38d56f6d942c677","tarball":"https://registry.npmjs.org/mongodb-queue-up/-/mongodb-queue-up-5.0.1.tgz","fileCount":4,"integrity":"sha512-oea6D5bXwmiRjdkyoQ7SQeIIEYcEY19QWg2u6joi3a1s1JtimqNykXjKa8jzsFB4HKMMlxoJdWtyV+WOUPzWRg==","signatures":[{"sig":"MEQCIH31tn2kg2jtMJHf2MqA1x7bbPNABk1zpGMUlQSjtKnCAiAa/VEO+GgQrGUwWMH433EBUsI++XXwnkCBAraSELtBgA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJiDcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqBA/8DRqeki+Yf+CB1qsKuCnZ7lqiRsJ04w00NvZ8bx5fI43NkYWZ\r\nq4Oao6u2YZnGCIuo0neGFuVsyxKW8G6fWbLtO1kHIEzkxbUFjG7/Elv6ypsD\r\nB28K1dzid1x3b6pwOJiTTpEbdP3oy+Z6Pq2IX/uSB0RM/whOluvwGn4Ogfu/\r\nqmRhVIQi5DE6CDFsZBs50+7sYs3FHPwFFDZHi8Odh8jOkQvr7pO1c1inmoaP\r\nXJabV2Dz7D5QwhzKIQoGgc+EvOuwcgnwUAfLd4mvc6bsMuvbGzQTfhfCCKTo\r\nKBT1Q3hr0EUYdwZMZjJJUx6litNgzTl4imkjXUN2I1RC0cC8uJ+PzoH3h7Xo\r\n+IN0CZbZ8ErPZgQLOiznHnxjge67A5OO3kYuURnPV4qIe9IE/0NGEyZxDS4R\r\nyFyEgZm6gGA/Syf/H0T3StvAmkHkQwdHVqbqxP97ApXLCWRZ2cC82Xq/ePEB\r\n6bq9GZqHHMeWZFyz8HB2Mk63i+tzIJVCCw/r/FQlfIKFkdHiemrztuQ/N1Bo\r\nPVQ0Y49BPkn9Pic6lIuLmHX5FPP27xJMXwXQ4FLhUQFB57VCahTvhS/8V5tk\r\nO9zFDvdVI0GGxTPfm2Uge2lhpFIqlyGNCzsEGON8/He6cpse4tusQ/HtL6W5\r\nbZLv2biSjxVq8gWF4iLOJa8TCRuAWQ3pif0=\r\n=UQXl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"mongodb-queue.js","types":"mongodb-queue.d.ts","gitHead":"cd914dc92808524a029ddd68ea22427b3df9b9e0","scripts":{"test":"set -e; for FILE in test/*.js; do echo --- $FILE ---; node $FILE; done"},"_npmUser":{"name":"mhassan1","email":"marc.j.hassan@gmail.com"},"repository":{"url":"git://github.com/mhassan1/mongodb-queue-up.git","type":"git"},"_npmVersion":"8.3.1","description":"Message queues which uses MongoDB.","directories":{},"_nodeVersion":"16.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.10.1","async":"^2.6.2","mongodb":"^4.4.1"},"peerDependencies":{"mongodb":"^4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-queue-up_5.0.1_1646665948178_0.1992915490720515","host":"s3://npm-registry-packages"}},"5.1.0":{"name":"mongodb-queue-up","version":"5.1.0","keywords":["mongodb","queue"],"license":"MIT","_id":"mongodb-queue-up@5.1.0","maintainers":[{"name":"mhassan1","email":"marc.j.hassan@gmail.com"}],"homepage":"https://github.com/mhassan1/mongodb-queue-up","bugs":{"url":"https://github.com/mhassan1/mongodb-queue-up/issues"},"dist":{"shasum":"de750703d4032a30816fd9f3e16d27cb28871fd4","tarball":"https://registry.npmjs.org/mongodb-queue-up/-/mongodb-queue-up-5.1.0.tgz","fileCount":4,"integrity":"sha512-dqoEHzYipEsdzn1ks57SKy7+vmFoeYIQs9AgSJULa1PW45rABBntHlUNX2ZFFVagXiC+y/FSZWFP+kZ/iIqXbg==","signatures":[{"sig":"MEUCIQCJwxn/iUt3lbc7/l/ZLE1O38VEz+MYGY1mZLygOesMWgIgGNT4TZ8tzciEwlyLc+sl/hkiUaw1iG77uTYMdHnlroQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26681},"main":"mongodb-queue.js","types":"mongodb-queue.d.ts","gitHead":"b53fa2272a136c25b2d27bc41be96d5188fda16f","scripts":{"test":"npm run test4 && npm run test5","test4":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v4 ---; node $FILE 4; done","test5":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v5 ---; node $FILE 5; done"},"_npmUser":{"name":"mhassan1","email":"marc.j.hassan@gmail.com"},"repository":{"url":"git://github.com/mhassan1/mongodb-queue-up.git","type":"git"},"_npmVersion":"9.6.7","description":"Message queues which uses MongoDB.","directories":{},"_nodeVersion":"18.17.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.10.1","async":"^2.6.2","mongodb4":"npm:mongodb@^4.4.1","mongodb5":"npm:mongodb@^5.7.0"},"peerDependencies":{"mongodb":"^4 || ^5"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-queue-up_5.1.0_1691179043765_0.4031812270288868","host":"s3://npm-registry-packages"}},"5.2.0":{"name":"mongodb-queue-up","version":"5.2.0","keywords":["mongodb","queue"],"license":"MIT","_id":"mongodb-queue-up@5.2.0","maintainers":[{"name":"mhassan1","email":"marc.j.hassan@gmail.com"}],"homepage":"https://github.com/mhassan1/mongodb-queue-up","bugs":{"url":"https://github.com/mhassan1/mongodb-queue-up/issues"},"dist":{"shasum":"7bfde0c4a0dee2f3d005f8070e6c403d6afb8d3f","tarball":"https://registry.npmjs.org/mongodb-queue-up/-/mongodb-queue-up-5.2.0.tgz","fileCount":4,"integrity":"sha512-BHBWSeBe1Ewrx8mUiVWc8BWlTYUgoPkTw/1h77fO7CV8gImQ+xNmAv+iSv1GC9opd/Ml2TIPxsFxnF/5r2KUCQ==","signatures":[{"sig":"MEUCIQCn9iMvt9FbuKLvxDUyzRdF12aEQJXJcDNeeA3izv/OMgIgU+VJfWQqMl89MjkYcHz4i5lnO+lWcS+wmGELtyqhN2A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27014},"main":"mongodb-queue.js","types":"mongodb-queue.d.ts","gitHead":"369c653d6d94b747f98bd223f6638869b2380284","scripts":{"test":"npm run test4 && npm run test5 && npm run test6","test4":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v4 ---; node $FILE 4; done","test5":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v5 ---; node $FILE 5; done","test6":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v6 ---; node $FILE 6; done"},"_npmUser":{"name":"mhassan1","email":"marc.j.hassan@gmail.com"},"repository":{"url":"git://github.com/mhassan1/mongodb-queue-up.git","type":"git"},"_npmVersion":"9.6.7","description":"Message queues which uses MongoDB.","directories":{},"_nodeVersion":"18.17.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.10.1","async":"^2.6.2","mongodb4":"npm:mongodb@^4.4.1","mongodb5":"npm:mongodb@^5.7.0","mongodb6":"npm:mongodb@^6.0.0"},"peerDependencies":{"mongodb":"^4 || ^5 || ^6"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-queue-up_5.2.0_1694446658912_0.18128129518856362","host":"s3://npm-registry-packages"}},"5.3.0":{"name":"mongodb-queue-up","version":"5.3.0","keywords":["mongodb","queue"],"license":"MIT","_id":"mongodb-queue-up@5.3.0","maintainers":[{"name":"mhassan1","email":"marc.j.hassan@gmail.com"}],"homepage":"https://github.com/mhassan1/mongodb-queue-up","bugs":{"url":"https://github.com/mhassan1/mongodb-queue-up/issues"},"dist":{"shasum":"8761faef71ca578c5608f5d97ed68caf0861090e","tarball":"https://registry.npmjs.org/mongodb-queue-up/-/mongodb-queue-up-5.3.0.tgz","fileCount":4,"integrity":"sha512-vOdhp3SFhpd2Gdr8RprkKZAOS8D4ymu3Vp1V46LzO+WsyoJGyAsG2APoH1f2O3R4MN+pGsrh3ZoiNbgp93INiQ==","signatures":[{"sig":"MEYCIQCyq3B7gxXzSTUz7rn5pT2xb072109VT+9Fpx/jIjX/ZgIhAO9PCCYVbK8/4v2n5u42eXvg5u4wSiTORYikpKxmrGAf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":30612},"main":"mongodb-queue.js","types":"mongodb-queue.d.ts","gitHead":"16786fd04b1b9a88b9f2b88139434f959907c9c8","scripts":{"test":"npm run test4 && npm run test5 && npm run test6","test4":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v4 ---; node $FILE 4; done","test5":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v5 ---; node $FILE 5; done","test6":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v6 ---; node $FILE 6; done"},"_npmUser":{"name":"mhassan1","email":"marc.j.hassan@gmail.com"},"repository":{"url":"git://github.com/mhassan1/mongodb-queue-up.git","type":"git"},"_npmVersion":"10.1.0","description":"Message queues which uses MongoDB.","directories":{},"_nodeVersion":"20.8.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.10.1","async":"^2.6.2","mongodb4":"npm:mongodb@^4.4.1","mongodb5":"npm:mongodb@^5.7.0","mongodb6":"npm:mongodb@^6.0.0"},"peerDependencies":{"mongodb":"^4 || ^5 || ^6"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-queue-up_5.3.0_1697146854704_0.17176692375411995","host":"s3://npm-registry-packages"}},"5.4.0":{"name":"mongodb-queue-up","version":"5.4.0","keywords":["mongodb","queue"],"license":"MIT","_id":"mongodb-queue-up@5.4.0","maintainers":[{"name":"mhassan1","email":"marc.j.hassan@gmail.com"}],"homepage":"https://github.com/mhassan1/mongodb-queue-up","bugs":{"url":"https://github.com/mhassan1/mongodb-queue-up/issues"},"dist":{"shasum":"b430936bb318da7f92fd66711ebb80c9522b970e","tarball":"https://registry.npmjs.org/mongodb-queue-up/-/mongodb-queue-up-5.4.0.tgz","fileCount":4,"integrity":"sha512-31zH15COy+POw8B98fUi6/lXgf/sLXJsYbT+a4B+bv4gG3BZ19LU3CVUi52Z8uQ3VYYK2BxyatwkSwnEhTKUWA==","signatures":[{"sig":"MEQCIBNPM8y4TjwL7fbMFpapavbc0uz4vLxmvgF4wf0/Z18GAiAbDGGPzFk4TxxeIdxOfj0h+jko/wjaklVaITyiVqhezA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":30770},"main":"mongodb-queue.js","types":"mongodb-queue.d.ts","gitHead":"a8a2ffcfd01c823abad85306e6b890d62672758b","scripts":{"test":"npm run test4 && npm run test5 && npm run test6","test4":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v4 ---; node $FILE 4; done","test5":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v5 ---; node $FILE 5; done","test6":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v6 ---; node $FILE 6; done"},"_npmUser":{"name":"mhassan1","email":"marc.j.hassan@gmail.com"},"repository":{"url":"git://github.com/mhassan1/mongodb-queue-up.git","type":"git"},"_npmVersion":"10.2.4","description":"Message queues which uses MongoDB.","directories":{},"_nodeVersion":"20.9.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.10.1","async":"^2.6.2","mongodb4":"npm:mongodb@^4.4.1","mongodb5":"npm:mongodb@^5.7.0","mongodb6":"npm:mongodb@^6.0.0"},"peerDependencies":{"mongodb":"^4 || ^5 || ^6"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-queue-up_5.4.0_1701912000396_0.25013142321734216","host":"s3://npm-registry-packages"}},"5.5.0":{"name":"mongodb-queue-up","version":"5.5.0","description":"Message queues which uses MongoDB.","main":"mongodb-queue.js","types":"mongodb-queue.d.ts","scripts":{"test":"npm run test4 && npm run test5 && npm run test6 && npm run test7","test4":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v4 ---; node $FILE 4; done","test5":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v5 ---; node $FILE 5; done","test6":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v6 ---; node $FILE 6; done","test7":"set -e; for FILE in test/*.js; do echo --- $FILE - mongodb v7 ---; node $FILE 7; done"},"dependencies":{},"devDependencies":{"async":"^3.2.6","mongodb":"^7.0.0","mongodb4":"npm:mongodb@^4.4.1","mongodb5":"npm:mongodb@^5.7.0","mongodb6":"npm:mongodb@^6.0.0","mongodb7":"npm:mongodb@^7.0.0","tape":"^5.9.0"},"peerDependencies":{"mongodb":"^4 || ^5 || ^6 || ^7"},"homepage":"https://github.com/mhassan1/mongodb-queue-up","repository":{"type":"git","url":"git://github.com/mhassan1/mongodb-queue-up.git"},"license":"MIT","keywords":["mongodb","queue"],"gitHead":"cfa615f1c86ceafd0e9b0c26399ef28b6c9a8bb2","_id":"mongodb-queue-up@5.5.0","bugs":{"url":"https://github.com/mhassan1/mongodb-queue-up/issues"},"_nodeVersion":"24.10.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-VL6p0fnmAd+vSCYxK3wfrZswH7a1/3LulGN//k08UNuyKhAsnvGuZj3st8MsS/kLHQGZO34WDyHJ9Ih2VX3k0w==","shasum":"00d65c93e4514240fcc24942b03bf4190b7d8b2c","tarball":"https://registry.npmjs.org/mongodb-queue-up/-/mongodb-queue-up-5.5.0.tgz","fileCount":4,"unpackedSize":31089,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFxhybyktr9QFWdUc3Q8u3Vkjd1hPlxRHeC3q9wlsDvqAiAaU1IEuSSvHqkew9fAmZvtGrdxsWjGtNp6/NCdLwxQ4A=="}]},"_npmUser":{"name":"mhassan1","email":"marc.j.hassan@gmail.com"},"directories":{},"maintainers":[{"name":"mhassan1","email":"marc.j.hassan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mongodb-queue-up_5.5.0_1763153239947_0.4641129106853361"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-07T15:04:42.459Z","modified":"2025-11-14T20:47:20.405Z","5.0.0":"2022-03-07T15:04:42.633Z","5.0.1":"2022-03-07T15:12:28.335Z","5.1.0":"2023-08-04T19:57:23.954Z","5.2.0":"2023-09-11T15:37:39.049Z","5.3.0":"2023-10-12T21:40:55.045Z","5.4.0":"2023-12-07T01:20:00.586Z","5.5.0":"2025-11-14T20:47:20.137Z"},"bugs":{"url":"https://github.com/mhassan1/mongodb-queue-up/issues"},"license":"MIT","homepage":"https://github.com/mhassan1/mongodb-queue-up","keywords":["mongodb","queue"],"repository":{"type":"git","url":"git://github.com/mhassan1/mongodb-queue-up.git"},"description":"Message queues which uses MongoDB.","maintainers":[{"name":"mhassan1","email":"marc.j.hassan@gmail.com"}],"readme":"# mongodb-queue-up #\n\n[![Build Status](https://github.com/mhassan1/mongodb-queue-up/actions/workflows/test.yml/badge.svg)](https://github.com/mhassan1/mongodb-queue-up/actions/workflows/test.yml) [![NPM](https://nodei.co/npm/mongodb-queue-up.png?mini=true)](https://nodei.co/npm/mongodb-queue-up/)\n\nThis is a fork of [mongodb-queue@4](https://www.npmjs.com/package/mongodb-queue/v/4.0.0) that adds support for MongoDB Driver v4, v5, v6, and v7.\n\nA really light-weight way to create queues with a nice API if you're already\nusing MongoDB.\n\nNow compatible with the MongoDB v4, v5, v6, and v7 drivers.\n\nFor MongoDB v3 driver use [mongodb-queue@4](https://www.npmjs.com/package/mongodb-queue/v/4.0.0).\n\nFor MongoDB v2 driver use [mongodb-queue@3](https://www.npmjs.com/package/mongodb-queue/v/3.1.0).\n\n**NOTE**: This package is considered feature complete and **STABLE** hence there is not a whole lot of development on\nit though it is being used extensively. Use it with all your might and let us know of any problems - it should be\nbullet-proof.\n\n## Synopsis ##\n\nCreate a connection to your MongoDB database, and use it to create a queue object:\n\n```js\nvar mongodb = require('mongodb')\nvar mongoDbQueue = require('mongodb-queue-up')\n\nconst url = 'mongodb://localhost:27017/'\nconst client = new mongodb.MongoClient(url)\n\nclient.connect(err => {\n  const db = client.db('test')\n  const queue = mongoDbQueue(db, 'my-queue')\n\n  // ...\n\n})\n```\n\nAdd a message to a queue:\n\n```js\nqueue.add('Hello, World!', (err, id) => {\n    // Message with payload 'Hello, World!' added.\n    // 'id' is returned, useful for logging.\n})\n```\n\nGet a message from the queue:\n\n```js\nqueue.get((err, msg) => {\n    console.log('msg.id=' + msg.id)\n    console.log('msg.ack=' + msg.ack)\n    console.log('msg.payload=' + msg.payload) // 'Hello, World!'\n    console.log('msg.tries=' + msg.tries)\n})\n```\n\nPing a message to keep it's visibility open for long-running tasks\n\n```js\nqueue.ping(msg.ack, (err, id) => {\n    // Visibility window now increased for this message id.\n    // 'id' is returned, useful for logging.\n})\n```\n\nAck a message (and remove it from the queue):\n\n```js\nqueue.ack(msg.ack, (err, id) => {\n    // This msg removed from queue for this ack.\n    // The 'id' of the message is returned, useful for logging.\n})\n```\n\nBy default, all old messages - even processed ones - are left in MongoDB. This is so that\nyou can go and analyse them if you want. However, you can call the following function\nto remove processed messages:\n\n```js\nqueue.clean((err) => {\n    // All processed (ie. acked) messages have been deleted\n})\n```\n\nAnd if you haven't already, you should call this to make sure indexes have\nbeen added in MongoDB. Of course, if you've called this once (in some kind\none-off script) you don't need to call it in your program. Of course, check\nthe changelock to see if you need to update them with new releases:\n\n```js\nqueue.createIndexes((err, indexName) => {\n    // The indexes needed have been added to MongoDB.\n})\n```\n\n## Creating a Queue ##\n\nTo create a queue, call the exported function with the `MongoClient`, the name\nand a set of opts. The MongoDB collection used is the same name as the name\npassed in:\n\n```\nvar mongoDbQueue = require('mongodb-queue-up')\n\n// an instance of a queue\nvar queue1 = mongoDbQueue(db, 'a-queue')\n// another queue which uses the same collection as above\nvar queue2 = mongoDbQueue(db, 'a-queue')\n```\n\nUsing `queue1` and `queue2` here won't interfere with each other and will play along nicely, but that's not\na good idea code-wise - just use the same object. This example is for illustrative purposes only.\n\nNote: Don't use the same queue name twice with different options, otherwise behaviour is undefined and again\nit's not something you should do.\n\nTo pass in options for the queue:\n\n```\nvar resizeQueue = mongoDbQueue(db, 'resize-queue', { visibility : 30, delay : 15 })\n```\n\nThis example shows a queue with a message visibility of 30s and a delay to each message of 15s.\n\n## Options ##\n\n### name ###\n\nThis is the name of the MongoDB Collection you wish to use to store the messages.\nEach queue you create will be it's own collection.\n\ne.g.\n\n```\nvar resizeImageQueue = mongoDbQueue(db, 'resize-image-queue')\nvar notifyOwnerQueue = mongoDbQueue(db, 'notify-owner-queue')\n```\n\nThis will create two collections in MongoDB called `resize-image-queue` and `notify-owner-queue`.\n\n### visibility - Message Visibility Window ###\n\nDefault: `30`\n\nBy default, if you don't ack a message within the first 30s after receiving it,\nit is placed back in the queue so it can be fetched again. This is called the\nvisibility window.\n\nYou may set this visibility window on a per queue basis. For example, to set the\nvisibility to 15 seconds:\n\n```\nvar queue = mongoDbQueue(db, 'queue', { visibility : 15 })\n```\n\nAll messages in this queue now have a visibility window of 15s, instead of the\ndefault 30s.\n\n### delay - Delay Messages on Queue ###\n\nDefault: `0`\n\nWhen a message is added to a queue, it is immediately available for retrieval.\nHowever, there are times when you might like to delay messages coming off a queue.\nie. if you set delay to be `10`, then every message will only be available for\nretrieval 10s after being added.\n\nTo delay all messages by 10 seconds, try this:\n\n```\nvar queue = mongoDbQueue(db, 'queue', { delay : 10 })\n```\n\nThis is now the default for every message added to the queue.\n\n### deadQueue - Dead Message Queue ###\n\nDefault: none\n\nMessages that have been retried over `maxRetries` will be pushed to this queue so you can\nautomatically see problem messages.\n\nPass in a queue (that you created) onto which these messages will be pushed:\n\n```js\nvar deadQueue = mongoDbQueue(db, 'dead-queue')\nvar queue = mongoDbQueue(db, 'queue', { deadQueue : deadQueue })\n```\n\nIf you pop a message off the `queue` over `maxRetries` times and still have not acked it,\nit will be pushed onto the `deadQueue` for you. This happens when you `.get()` (not when\nyou miss acking a message in it's visibility window). By doing it when you call `.get()`,\nthe unprocessed message will be received, pushed to the `deadQueue`, acked off the normal\nqueue and `.get()` will check for new messages prior to returning you one (or none).\n\n### maxRetries - Maximum Retries per Message ###\n\nDefault: 5\n\nThis option only comes into effect if you pass in a `deadQueue` as shown above. What this\nmeans is that if an item is popped off the queue `maxRetries` times (e.g. 5) and not acked,\nit will be moved to this `deadQueue` the next time it is tried to pop off. You can poll your\n`deadQueue` for dead messages much like you can poll your regular queues.\n\nThe payload of the messages in the dead queue are the entire messages returned when `.get()`ing\nthem from the original queue.\n\ne.g.\n\nGiven this message:\n\n```\nmsg = {\n  id: '533b1eb64ee78a57664cc76c',\n  ack: 'c8a3cc585cbaaacf549d746d7db72f69',\n  payload: 'Hello, World!',\n  tries: 1\n}\n```\n\nIf it is not acked within the `maxRetries` times, then when you receive this same message\nfrom the `deadQueue`, it may look like this:\n\n```\nmsg = {\n  id: '533b1ecf3ca3a76b667671ef',\n  ack: '73872b204e3f7be84050a1ce82c5c9c0',\n  payload: {\n    id: '533b1eb64ee78a57664cc76c',\n    ack: 'c8a3cc585cbaaacf549d746d7db72f69',\n    payload: 'Hello, World!',\n    tries: 5\n  },\n  tries: 1\n}\n```\n\nNotice that the payload from the `deadQueue` is exactly the same as the original message\nwhen it was on the original queue (except with the number of tries set to 5).\n\n## Operations ##\n\n### .add() ###\n\nYou can add a string to the queue:\n\n```js\nqueue.add('Hello, World!', (err, id) => {\n    // Message with payload 'Hello, World!' added.\n    // 'id' is returned, useful for logging.\n})\n```\n\nOr add an object of your choosing:\n\n```js\nqueue.add({ err: 'E_BORKED', msg: 'Broken' }, (err, id) => {\n    // Message with payload { err: 'E_BORKED', msg: 'Broken' } added.\n    // 'id' is returned, useful for logging.\n})\n```\n\nOr add multiple messages:\n\n```js\nqueue.add(['msg1', 'msg2', 'msg3'], (err, ids) => {\n    // Messages with payloads 'msg1', 'msg2' & 'msg3' added.\n    // All 'id's are returned as an array, useful for logging.\n})\n```\n\nYou can delay individual messages from being visible by passing the `delay` option:\n\n```js\nqueue.add('Later', { delay: 120 }, (err, id) => {\n    // Message with payload 'Later' added.\n    // 'id' is returned, useful for logging.\n    // This message won't be available for getting for 2 mins.\n})\n```\n\n### .get() ###\n\nRetrieve a message from the queue:\n\n```js\nqueue.get((err, msg) => {\n    // You can now process the message\n    // IMPORTANT: The callback will not wait for an message if the queue is empty.  The message will be undefined if the queue is empty.\n})\n```\n\nYou can choose the visibility of an individual retrieved message by passing the `visibility` option:\n\n```js\nqueue.get({ visibility: 10 }, (err, msg) => {\n    // You can now process the message for 10s before it goes back into the queue if not ack'd instead of the duration that is set on the queue in general\n})\n```\n\nMessage will have the following structure:\n\n```js\n{\n  id: '533b1eb64ee78a57664cc76c', // ID of the message\n  ack: 'c8a3cc585cbaaacf549d746d7db72f69', // ID for ack and ping operations\n  payload: 'Hello, World!', // Payload passed when the message was addded\n  tries: 1 // Number of times this message has been retrieved from queue without being ack'd\n}\n```\n\n### .ack() ###\n\nAfter you have received an item from a queue and processed it, you can delete it\nby calling `.ack()` with the unique `ackId` returned:\n\n```js\nqueue.get((err, msg) => {\n    queue.ack(msg.ack, (err, id) => {\n        // this message has now been removed from the queue\n    })\n})\n```\n\n### .ping() ###\n\nAfter you have received an item from a queue and you are taking a while\nto process it, you can `.ping()` the message to tell the queue that you are\nstill alive and continuing to process the message:\n\n```js\nqueue.get((err, msg) => {\n    queue.ping(msg.ack, (err, id) => {\n        // this message has had it's visibility window extended\n    })\n})\n```\n\nYou can also choose the visibility time that gets added by the ping operation by passing the `visibility` option:\n\n```js\nqueue.get((err, msg) => {\n    queue.ping(msg.ack, { visibility: 10 }, (err, id) => {\n        // this message has had it's visibility window extended by 10s instead of the visibilty set on the queue in general\n    })\n})\n```\n\n### .total() ###\n\nReturns the total number of messages that has ever been in the queue, including\nall current messages:\n\n```js\nqueue.total((err, count) => {\n    console.log('This queue has seen %d messages', count)\n})\n```\n\n### .size() ###\n\nReturns the total number of messages that are waiting in the queue.\n\n```js\nqueue.size((err, count) => {\n    console.log('This queue has %d current messages', count)\n})\n```\n\nUse `listWaiting` to get the messages, themselves.\n\n### .listWaiting() ###\n\nReturns the list of messages that are waiting in the queue.\n\n```js\nqueue.listWaiting((err, messages) => {\n    console.log('This queue has %d current messages', messages.length)\n})\n```\n\nThe message structure will match `get`.\n\nUse `size` to just get the count.\n\n### .inFlight() ###\n\nReturns the total number of messages that are currently in flight, i.e. that\nhave been retrieved, not yet acknowledged, but are being pinged:\n\n```js\nqueue.inFlight((err, count) => {\n    console.log('A total of %d messages are currently being processed', count)\n})\n```\n\nUse `listInFlight` to get the messages, themselves.\n\n### .listInFlight() ###\n\nReturns the list of messages that are currently in flight, i.e. that\nhave been retrieved, not yet acknowledged, but are being pinged:\n\n```js\nqueue.listInFlight((err, messages) => {\n    console.log('A total of %d messages are currently being processed', messages.length)\n})\n```\n\nThe message structure will match `get`.\n\nUse `inFlight` to just get the count.\n\n### .incomplete() ###\n\nReturns the total number of messages that are currently incomplete, i.e. that\nhave been retrieved, not yet acknowledged, but may or may not be getting pinged:\n\n```js\nqueue.incomplete((err, count) => {\n    console.log('A total of %d messages are currently incomplete', count)\n})\n```\n\nUse `listIncomplete` to get the messages, themselves.\n\n### .listIncomplete() ###\n\nReturns the list of messages that are currently incomplete, i.e. that\nhave been retrieved, not yet acknowledged, but may or may not be getting pinged:\n\n```js\nqueue.listIncomplete((err, messages) => {\n    console.log('A total of %d messages are currently incomplete', messages.length)\n})\n```\n\nThe message structure will match `get`.\n\nUse `incomplete` to just get the count.\n\n### .done() ###\n\nReturns the total number of messages that have been processed correctly in the\nqueue:\n\n```js\nqueue.done((err, count) => {\n    console.log('This queue has processed %d messages', count)\n})\n```\n\n### .clean() ###\n\nDeletes all processed mesages from the queue. Of course, you can leave these hanging around\nif you wish, but delete them if you no longer need them. Perhaps do this using `setInterval`\nfor a regular cleaning:\n\n```js\nqueue.clean((err) => {\n    console.log('The processed messages have been deleted from the queue')\n})\n```\n\n### Notes about Numbers ###\n\nIf you add up `.size() + .inFlight() + .done()` then you should get `.total()`\n(excluding any messages added with a `delay`)\nbut this will only be approximate since these are different operations hitting the database\nat slightly different times. Hence, a message or two might be counted twice or not at all\ndepending on message turnover at any one time. You should not rely on these numbers for\nanything but are included as approximations at any point in time.\n\n## Use of MongoDB ##\n\nWhilst using MongoDB recently and having a need for lightweight queues, I realised\nthat the atomic operations that MongoDB provides are ideal for this kind of job.\n\nSince everything it atomic, it is impossible to lose messages in or around your\napplication. I guess MongoDB could lose them but it's a safer bet it won't compared\nto your own application.\n\nAs an example of the atomic nature being used, messages stay in the same collection\nand are never moved around or deleted, just a couple of fields are set, incremented\nor deleted. We always use MongoDB's excellent `collection.findAndModify()` so that\neach message is updated atomically inside MongoDB and we never have to fetch something,\nchange it and store it back.\n\n## Roadmap ##\n\nWe may add the ability for each function to return a promise in the future so it can be used as such, or with\nasync/await.\n\n## Releases ##\n\n### 5.5.0 (2025-11-14) ###\n\n* [NEW] Added support for mongodb driver v7\n\n### 5.4.0 (2023-10-12) ###\n\n* [NEW] Replaced `deleted:{$exists:true}` with `deleted:{$ne:null}` for better index usage\n\n### 5.3.0 (2023-10-12) ###\n\n* [NEW] Added `listWaiting`, `listInFlight`, `incomplete`, and `listIncomplete` methods\n\n### 5.2.0 (2023-09-11) ###\n\n* [NEW] Added support for mongodb driver v6\n\n### 5.1.0 (2023-08-04) ###\n\n* [NEW] Added support for mongodb driver v5\n\n### 5.0.1 (2022-03-07) ###\n\n* [DOC] Fixed travis badge\n\n### 5.0.0 (2022-03-07) ###\n\n* [NEW] Added support for mongodb driver v4\n* [NEW] Added typescript types\n\n### 4.0.0 (2019-02-20) ###\n\n* [NEW] Updated entire codebase to be compatible with the mongodb driver v3\n\n### 2.1.0 (2016-04-21) ###\n\n* [FIX] Fix to indexes (thanks https://github.com/ifightcrime) when lots of messages\n\n### 2.0.0 (2014-11-12) ###\n\n* [NEW] Update MongoDB API from v1 to v2 (thanks https://github.com/hanwencheng)\n\n### 1.0.1 (2015-05-25) ###\n\n* [NEW] Test changes only\n\n### 1.0.0 (2014-10-30) ###\n\n* [NEW] Ability to specify a visibility window when getting a message (thanks https://github.com/Gertt)\n\n### 0.9.1 (2014-08-28) ###\n\n* [NEW] Added .clean() method to remove old (processed) messages\n* [NEW] Add 'delay' option to queue.add() so individual messages can be delayed separately\n* [TEST] Test individual 'delay' option for each message\n\n### 0.7.0 (2014-03-24) ###\n\n* [FIX] Fix .ping() so only visible/non-deleted messages can be pinged\n* [FIX] Fix .ack() so only visible/non-deleted messages can be pinged\n* [TEST] Add test to make sure messages can't be acked twice\n* [TEST] Add test to make sure an acked message can't be pinged\n* [INTERNAL] Slight function name changes, nicer date routines\n\n### 0.6.0 (2014-03-22) ###\n\n* [NEW] The msg.id is now returned on successful Queue.ping() and Queue.ack() calls\n* [NEW] Call quueue.ensureIndexes(callback) to create them\n* [CHANGE] When a message is acked, 'deleted' is now set to the current time (not true)\n* [CHANGE] The queue is now created synchronously\n\n### 0.5.0 (2014-03-21) ###\n\n* [NEW] Now adds two indexes onto the MongoDB collection used for the message\n* [CHANGE] The queue is now created by calling the async exported function\n* [DOC] Update to show how the queues are now created\n\n### 0.4.0 (2014-03-20) ###\n\n* [NEW] Ability to ping retrieved messages a. la. 'still alive' and 'extend visibility'\n* [CHANGE] Removed ability to have different queues in the same collection\n* [CHANGE] All queues are now stored in their own collection\n* [CHANGE] When acking a message, only need ack (no longer need id)\n* [TEST] Added test for pinged messages\n* [DOC] Update to specify each queue will create it's own MongoDB collection\n* [DOC] Added docs for option `delay`\n* [DOC] Added synopsis for Queue.ping()\n* [DOC] Removed use of msg.id when calling Queue.ack()\n\n### 0.3.1 (2014-03-19) ###\n\n* [DOC] Added documentation for the `delay` option\n\n### 0.3.0 (2014-03-19) ###\n\n* [NEW] Return the message id when added to a queue\n* [NEW] Ability to set a default delay on all messages in a queue\n* [FIX] Make sure old messages (outside of visibility window) aren't deleted when acked\n* [FIX] Internal: Fix `queueName`\n* [TEST] Added test for multiple messages\n* [TEST] Added test for delayed messages\n\n### 0.2.1 (2014-03-19) ###\n\n* [FIX] Fix when getting messages off an empty queue\n* [NEW] More Tests\n\n### 0.2.0 (2014-03-18) ###\n\n* [NEW] messages now return number of tries (times they have been fetched)\n\n### 0.1.0 (2014-03-18) ###\n\n* [NEW] add messages to queues\n* [NEW] fetch messages from queues\n* [NEW] ack messages on queues\n* [NEW] set up multiple queues\n* [NEW] set your own MongoDB Collection name\n* [NEW] set a visibility timeout on a queue\n\n## License ##\n\nMIT\n\n(Ends)\n","readmeFilename":"README.md"}