code: function replayEvents(mongoClient, events) {
    for (let i = 0; i < events.length; i++) {
      mongoClient.emit(events[i].event, events[i].object1, events[i].object2);
    }
  }
docs: Replay any events due to single server connection switching to Mongos