Closed bassjacob closed 7 years ago
Sure, that would be nice 😃 Are you interested in making a PR?
There where actually an attempt to do this last year in this PR: https://github.com/watson/mongodown/pull/3 - maybe you can learn something from that 😃
That was what sparked my interest :smile: I'm in still in discovery mode for the feature, but I'm happy to take a stab at it. The "query string" approach looks fine to me, obviously as long as levelup doesn't ship a conflicting query param name. Would you be ok with something like:
var db = levelup('localhost/my-database?mongodown_collection=foo', { db: require('mongodown') });
As far as I know levelup doesn't use that string for anything. It just passes it directly into the db
instance. So I think we're free do do with it what we want. So we could just call it collection
and then separate it from the self.location
string inside the _open
function. Or even better, already in the constructor function before passing it into AbstractLevelDOWN
Hi,
I'm looking to use this package as part of some framework code and I think it would be useful to be able to set the collection name as part of the constructor. Is that behaviour that you'd be interested in?