After connection to multiple databases by using MongoInternals.RemoteCollectionDriver
we get a lot of opened connections. Meteor’s ‘mongo’ package does not contain any function for closing opened connections.
So, there is a link to the remote collection driver of this package: (https://github.com/meteor/meteor/blob/devel/packages/mongo/remote_collection_driver.js)
It has a function to open connections but there is not any function to close connections.
_.extend(MongoInternals.RemoteCollectionDriver.prototype, {
open: function (name) {
var self = this;
var ret = {};
_.each(
['find', 'findOne', 'insert', 'update', 'upsert',
'remove', '_ensureIndex', '_dropIndex', '_createCappedCollection',
'dropCollection', 'rawCollection'],
function (m) {
ret[m] = _.bind(self.mongo[m], self.mongo, name);
});
return ret;
}
});
Is there any possible solution to close opened connections to the collections from remote database?