From 1609a371804f17648239f3b1d4d8b29bbbd4b3fe Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Mon, 2 Oct 2017 14:55:57 -0400 Subject: [PATCH] feat(topologies): expose underlaying `logicalSessionTimeoutMinutes' NODE-1088 --- lib/topologies/mongos.js | 7 +++++++ lib/topologies/replset.js | 7 +++++++ lib/topologies/server.js | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/lib/topologies/mongos.js b/lib/topologies/mongos.js index 315edcadf2..6ab231d302 100644 --- a/lib/topologies/mongos.js +++ b/lib/topologies/mongos.js @@ -266,6 +266,13 @@ Object.defineProperty(Mongos.prototype, 'haInterval', { } }); +Object.defineProperty(Mongos.prototype, 'logicalSessionTimeoutMinutes', { + enumerable: true, + get: function() { + return this.s.coreTopology.logicalSessionTimeoutMinutes; + } +}); + // Connect Mongos.prototype.connect = function(db, _options, callback) { var self = this; diff --git a/lib/topologies/replset.js b/lib/topologies/replset.js index 0d0d27932c..906a5b34b9 100644 --- a/lib/topologies/replset.js +++ b/lib/topologies/replset.js @@ -291,6 +291,13 @@ Object.defineProperty(ReplSet.prototype, 'haInterval', { } }); +Object.defineProperty(ReplSet.prototype, 'logicalSessionTimeoutMinutes', { + enumerable: true, + get: function() { + return this.s.coreTopology.logicalSessionTimeoutMinutes; + } +}); + var define = (ReplSet.define = new Define('ReplSet', ReplSet, false)); // Ensure the right read Preference object diff --git a/lib/topologies/server.js b/lib/topologies/server.js index dc9921936e..526a5c2beb 100644 --- a/lib/topologies/server.js +++ b/lib/topologies/server.js @@ -288,6 +288,13 @@ Object.defineProperty(Server.prototype, 'port', { } }); +Object.defineProperty(Server.prototype, 'logicalSessionTimeoutMinutes', { + enumerable: true, + get: function() { + return this.s.coreTopology.logicalSessionTimeoutMinutes; + } +}); + // Connect // Server.prototype.connect = function(db, _options, callback) { Server.prototype.connect = function(_options, callback) {