This repository has been archived by the owner on Nov 6, 2019. It is now read-only.
Added support for specifying collection name for client #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses issue #56 by moving where the collection name can be specified to the client/connection so that all queues and workers of that connection will use the specified collection name.
The name is not set in the options parameter, as that set of options is used by mongojs for other purposes. Instead, I've added a third parameter, 'collectionParameters'. The only valid value for that object currently is 'name'. I'm using an object here, because I'm toying with the idea of adding other collection defining variables, such as those to create a capped collection.
This is a non breaking change, and 'jobs' is still the default should you not provide a collection name to use. Below is an example using the new parameter.
var client = monq('mongodb://localhost:27017/monq_example', [], { name: '_jobqueue' });