Skip to content

Commit

Permalink
refactor(topology-base): track support for session capability
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Oct 12, 2017
1 parent 1609a37 commit e8933bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/topologies/topology_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ var ServerCapabilities = function(ismaster) {
var maxNumberOfDocsInBatch = ismaster.maxWriteBatchSize || 1000;
var commandsTakeWriteConcern = false;
var commandsTakeCollation = false;
var sessionSupport = false;

if (ismaster.minWireVersion >= 0) {
textSearch = true;
Expand Down Expand Up @@ -236,6 +237,10 @@ var ServerCapabilities = function(ismaster) {
ismaster.maxWireVersion = 0;
}

if (typeof ismaster.logicalSessionTimeoutMinutes !== 'undefined') {
sessionSupport = true;
}

// Map up read only parameters
setup_get_property(this, 'hasAggregationCursor', aggregationCursor);
setup_get_property(this, 'hasWriteCommands', writeCommands);
Expand All @@ -248,6 +253,7 @@ var ServerCapabilities = function(ismaster) {
setup_get_property(this, 'maxNumberOfDocsInBatch', maxNumberOfDocsInBatch);
setup_get_property(this, 'commandsTakeWriteConcern', commandsTakeWriteConcern);
setup_get_property(this, 'commandsTakeCollation', commandsTakeCollation);
setup_get_property(this, 'hasSessionSupport', sessionSupport);
};

exports.Store = Store;
Expand Down

0 comments on commit e8933bb

Please sign in to comment.