watson / mongodown

A drop-in replacement for LevelDOWN that runs on MongoDB
MIT License
28 stars 16 forks source link

Added ability to pass a custom collection name defaults to "mongodown". #7

Closed tejzpr closed 7 years ago

davidguttman commented 7 years ago

I would also like this feature =)

Looking at this change it seems like it would be possible to get into trouble with more than one level instance. collection is defined outside the scope of the db instance, and is overwritten on each instantiation. I think this could lead to a confusing bug if you instantiate two dbs with different collection names.

Here's a PR that was (in addition to something else) trying to configure the collection name: https://github.com/watson/mongodown/pull/3/files#diff-168726dbe96b3ce427e7fedce31bb0bcR54

tejzpr commented 7 years ago

I have updated the code to address the issue you raised. 👍

davidguttman commented 7 years ago

@watson what do you think?

tejzpr commented 7 years ago

@watson Can we merge this code? This fix will allow running multiple mongodown's on a single mongodb database without any issues.

davidguttman commented 7 years ago

@tejzpr published in v1.2.0 🎉

tejzpr commented 7 years ago

@davidguttman 👍