-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make [collections] optional on connect #9
Comments
That would be nice, but I love passing an array to select multiple collections at once. So I think the best solution would be to keep the second argument of connect, but just make it optional, and then add a .collection method like several other drivers. |
The collections array in the constructor should already be optional an there actually already is a method on db called
Hope that answers your question. |
That's awesome! Do you need someone to update the documentation so people know that it's optional? |
Yes that would be great! |
Documentation updated with f118ee8 with an example on how to use collections dynamically |
I'm not familiar enough with the native mongodb driver to know if this is possible, but in drivers for other languages I'm not forced to create an array of all of the collections contained in my database.
Instead of this:
db = require('mongojs').connect('db', ['coll1', 'coll2', 'coll3', 'coll4', 'coll5', 'coll6', 'coll7', 'coll8', 'coll9']);
It would be much more convenient to be able to just do the following and have access to all of those collections:
db = require('mongojs').connect('db');
The text was updated successfully, but these errors were encountered: