Expose the 'close' method for mongo driver.

This commit is contained in:
Slava Kim
2013-05-21 14:30:41 -07:00
parent 55fbfcb6f3
commit c9d71aa38f

View File

@@ -123,6 +123,14 @@ _Mongo = function (url) {
});
};
_Mongo.prototype.close = function() {
var self = this;
// Use Future.wrap so that errors get thrown. This happens to
// work even outside a fiber since the 'close' method is not
// actually asynchronous.
Future.wrap(_.bind(self.db.close, self.db))(true).wait();
};
// Returns the Mongo Collection object; may yield.
_Mongo.prototype._getCollection = function(collectionName) {
var self = this;