Skip to content

Commit b95d64e

Browse files
Sam Paldaprahamian
Sam Pal
authored andcommitted
fix(ClientSessions): initialize clientOptions and cluster time
Fixes NODE-1557
1 parent b146e26 commit b95d64e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/core/sessions.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class ClientSession extends EventEmitter {
7070
}
7171

7272
options = options || {};
73+
clientOptions = clientOptions || {};
74+
7375
this.topology = topology;
7476
this.sessionPool = sessionPool;
7577
this.hasEnded = false;
@@ -81,12 +83,7 @@ class ClientSession extends EventEmitter {
8183
typeof options.causalConsistency !== 'undefined' ? options.causalConsistency : true
8284
};
8385

84-
options = options || {};
85-
if (typeof options.initialClusterTime !== 'undefined') {
86-
this.clusterTime = options.initialClusterTime;
87-
} else {
88-
this.clusterTime = null;
89-
}
86+
this.clusterTime = options.initialClusterTime;
9087

9188
this.operationTime = null;
9289
this.explicit = !!options.explicit;

0 commit comments

Comments
 (0)