Skip to content

Commit e8933bb

Browse files
committed
refactor(topology-base): track support for session capability
NODE-1088
1 parent 1609a37 commit e8933bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/topologies/topology_base.js

+6
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ var ServerCapabilities = function(ismaster) {
203203
var maxNumberOfDocsInBatch = ismaster.maxWriteBatchSize || 1000;
204204
var commandsTakeWriteConcern = false;
205205
var commandsTakeCollation = false;
206+
var sessionSupport = false;
206207

207208
if (ismaster.minWireVersion >= 0) {
208209
textSearch = true;
@@ -236,6 +237,10 @@ var ServerCapabilities = function(ismaster) {
236237
ismaster.maxWireVersion = 0;
237238
}
238239

240+
if (typeof ismaster.logicalSessionTimeoutMinutes !== 'undefined') {
241+
sessionSupport = true;
242+
}
243+
239244
// Map up read only parameters
240245
setup_get_property(this, 'hasAggregationCursor', aggregationCursor);
241246
setup_get_property(this, 'hasWriteCommands', writeCommands);
@@ -248,6 +253,7 @@ var ServerCapabilities = function(ismaster) {
248253
setup_get_property(this, 'maxNumberOfDocsInBatch', maxNumberOfDocsInBatch);
249254
setup_get_property(this, 'commandsTakeWriteConcern', commandsTakeWriteConcern);
250255
setup_get_property(this, 'commandsTakeCollation', commandsTakeCollation);
256+
setup_get_property(this, 'hasSessionSupport', sessionSupport);
251257
};
252258

253259
exports.Store = Store;

0 commit comments

Comments
 (0)