Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

wish: document the name of the collection(s) used by 'monq' #56

Open
markstos opened this issue Nov 12, 2015 · 1 comment
Open

wish: document the name of the collection(s) used by 'monq' #56

markstos opened this issue Nov 12, 2015 · 1 comment

Comments

@markstos
Copy link

I'm considering adding a 'monq' job queue to an existing database. It would be helpful if the names of any collections used were documented so it would be clear if there was a conflict.

@scttnlsn
Copy link
Owner

All jobs will be saved to the jobs collection by default. I'm realizing there's actually not a very good way to configure that though. The way it's setup currently, you'd need to specify the collection for each queue:

var foo = client.queue('foo', { collection: 'myjobs' });
var bar = client.queue('bar', { collection: 'myjobs' });

And likely again for the workers:

var worker = client.worker([
  client.queue('foo', { collection: 'myjobs' }),
  client.queue('bar', { collection: 'myjobs' })
]);

This doesn't really make a lot of sense. Perhaps we should allow the default collection to be changed globally for the whole client connection? What do you think?

var client = monq('mongodb://localhost:27017/monq_example', { collection: 'myjobs' });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants