connect-mongodb
connect-mongodb copied to clipboard
Asynchronous execution of callback in MongoStore constructor
The callback provided to the MongStore constructor is now executed asynchronuosly.
This makes sure that a variable assigned to the constructor call already has its value (and thus can be referenced from inside the callback) when executing the callback.
Example:
var store = new MongoStore(options, function(){
// We now can use the newly created store directly inside the callback.
// Prior to this version store would still be uninitialized at this point.
store.doSomeFunkyStuff(...);
});