@universal-packages/background-jobs-mongodb
v1.0.0
Published
MongoDB queue for universal-background-jobs
Downloads
15
Readme
Background BackgroundJobs MongoDB
MongoDB queue adapter for universal-background-jobs.
Install
npm install @universal-packages/background-jobs-mongodb
npm install @universal-packages/background-jobs
MongoQueue
Just pass this engine to the BackgroundJobs instance to enable it to use mongodb as the queue system.
import { BackgroundJobs } from '@universal-packages/universal-background-jobs'
import { MongoQueue } from '@universal-packages/universal-background-jobs-mongodb'
const jobs = new BackgroundJobs({ queue: 'mongodb', queueOptions: { url: 'mongodb://localhost:27017' } })
await backgroundJobs.prepare()
Options
MongoQueue
takes the same options as the mongodb queue instance.
Additionally takes the following ones:
globalClient
String
If the mongodb client lives in a global variable, name it here.
Typescript
This library is developed in TypeScript and shipped fully typed.
Contributing
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.