don't call open again if it's already opened #94

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@Sguo12
Sguo12 commented Feb 11, 2014

This gets rid of the exception when I pass in a mongoose db that's already opened.

@NicolasPelletier

Shouldn't this be

cb(null);
@NicolasPelletier

+1 on this.

I have an opened database already and I just want connect-mongo to use it as-is. My solution so far was not to pass any callback ( in which case _open_database() is not called ), but this is a trick I do because I saw in the code that it solved my problem. Using this patch is a much better approach.

@jdesboeufs jdesboeufs added a commit that referenced this pull request Dec 24, 2014
@jdesboeufs Rewrite MongoStore initialization
* Re-use existing or upcoming mongoose connection
* Re-use existing or upcoming node-mongodb-native connection
* Accept full-featured MongoDB connection strings + advanced options
* Compatible with legacy config
* Replace callback by `connected` event
* Add debug

Fix #51, #58, #62, #66, #70, #85, #94, #96, #115, #117, #120
Fix #124, #128, #129, #130, #131, #133, #134
ca40b78
@jdesboeufs jdesboeufs closed this Dec 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment