code: function () {
          // release all pending connections
          util.each(this.connections, function (connection, threadId, connections) {
              try {
                  connection.release();
              }
              catch (e) { } // nothing to do with error
              delete connections[threadId];
          });
  
          // execute end on the db. will end pool if pool, or otherwise will execute whatever `end` that has been
          // exposed by db.js
          util.each(this.sources, function (source, identity, sources) {
              try {
                  source && source.end();
              }
              catch (e) { } // nothing to do with error
              delete sources[identity];
          });
      }
docs: ORM teardown sequencing for all replica set pools