MCPcopy
hub / github.com/mongodb/node-mongodb-native / serverSession

Method serverSession

src/sessions.ts:214–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

212 }
213
214 get serverSession(): ServerSession {
215 let serverSession = this._serverSession;
216 if (serverSession == null) {
217 if (this.explicit) {
218 throw new MongoRuntimeError('Unexpected null serverSession for an explicit session');
219 }
220 if (this.hasEnded) {
221 throw new MongoRuntimeError('Unexpected null serverSession for an ended implicit session');
222 }
223 serverSession = this.sessionPool.acquire();
224 this._serverSession = serverSession;
225 }
226 return serverSession;
227 }
228
229 get loadBalanced(): boolean {
230 return this.client.topology?.description.type === TopologyType.LoadBalanced;

Callers

nothing calls this directly

Calls 1

acquireMethod · 0.80

Tested by

no test coverage detected