-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathClientSession.html
139 lines (139 loc) · 176 KB
/
ClientSession.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ClientSession | mongodb</title><meta name="description" content="Documentation for mongodb"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">mongodb</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">mongodb</a></li><li><a href="ClientSession.html">ClientSession</a></li></ul><h1>Class ClientSession</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>A class representing a client session on the server</p>
</div><div><p>NOTE: not meant to be instantiated directly.</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="TypedEventEmitter.html" class="tsd-signature-type" data-tsd-kind="Class">TypedEventEmitter</a><span class="tsd-signature-symbol"><</span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">></span><ul class="tsd-hierarchy"><li><span class="target">ClientSession</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#clientOptions" class="tsd-kind-icon">client<wbr/>Options</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#clusterTime" class="tsd-kind-icon">cluster<wbr/>Time</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#defaultTransactionOptions" class="tsd-kind-icon">default<wbr/>Transaction<wbr/>Options</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#explicit" class="tsd-kind-icon">explicit</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#hasEnded" class="tsd-kind-icon">has<wbr/>Ended</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#operationTime" class="tsd-kind-icon">operation<wbr/>Time</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#supports" class="tsd-kind-icon">supports</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#transaction" class="tsd-kind-icon">transaction</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#captureRejectionSymbol" class="tsd-kind-icon">capture<wbr/>Rejection<wbr/>Symbol</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#captureRejections" class="tsd-kind-icon">capture<wbr/>Rejections</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#defaultMaxListeners" class="tsd-kind-icon">default<wbr/>Max<wbr/>Listeners</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#errorMonitor" class="tsd-kind-icon">error<wbr/>Monitor</a></li></ul></section><section class="tsd-index-section "><h3>Accessors</h3><ul class="tsd-index-list"><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#isPinned" class="tsd-kind-icon">is<wbr/>Pinned</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#loadBalanced" class="tsd-kind-icon">load<wbr/>Balanced</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#serverSession" class="tsd-kind-icon">server<wbr/>Session</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#snapshotEnabled" class="tsd-kind-icon">snapshot<wbr/>Enabled</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#abortTransaction" class="tsd-kind-icon">abort<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#addListener" class="tsd-kind-icon">add<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#advanceClusterTime" class="tsd-kind-icon">advance<wbr/>Cluster<wbr/>Time</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#advanceOperationTime" class="tsd-kind-icon">advance<wbr/>Operation<wbr/>Time</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#commitTransaction" class="tsd-kind-icon">commit<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#emit" class="tsd-kind-icon">emit</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#endSession" class="tsd-kind-icon">end<wbr/>Session</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#equals" class="tsd-kind-icon">equals</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="ClientSession.html#eventNames" class="tsd-kind-icon">event<wbr/>Names</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="ClientSession.html#getMaxListeners" class="tsd-kind-icon">get<wbr/>Max<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#inTransaction" class="tsd-kind-icon">in<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#incrementTransactionNumber" class="tsd-kind-icon">increment<wbr/>Transaction<wbr/>Number</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#listenerCount" class="tsd-kind-icon">listener<wbr/>Count</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#listeners" class="tsd-kind-icon">listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#off" class="tsd-kind-icon">off</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#on" class="tsd-kind-icon">on</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#once" class="tsd-kind-icon">once</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#prependListener" class="tsd-kind-icon">prepend<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#prependOnceListener" class="tsd-kind-icon">prepend<wbr/>Once<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#rawListeners" class="tsd-kind-icon">raw<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#removeAllListeners" class="tsd-kind-icon">remove<wbr/>All<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#removeListener" class="tsd-kind-icon">remove<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="ClientSession.html#setMaxListeners" class="tsd-kind-icon">set<wbr/>Max<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#startTransaction" class="tsd-kind-icon">start<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#toBSON" class="tsd-kind-icon">toBSON</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="ClientSession.html#withTransaction" class="tsd-kind-icon">with<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#getEventListeners" class="tsd-kind-icon">get<wbr/>Event<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#listenerCount-1" class="tsd-kind-icon">listener<wbr/>Count</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#on-1" class="tsd-kind-icon">on</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#once-1" class="tsd-kind-icon">once</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#setMaxListeners-1" class="tsd-kind-icon">set<wbr/>Max<wbr/>Listeners</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="clientOptions" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagOptional">Optional</span> client<wbr/>Options<a href="#clientOptions" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">client<wbr/>Options<span class="tsd-signature-symbol">?:</span> <a href="../interfaces/MongoOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">MongoOptions</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L105">src/sessions.ts:105</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="clusterTime" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagOptional">Optional</span> cluster<wbr/>Time<a href="#clusterTime" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">cluster<wbr/>Time<span class="tsd-signature-symbol">?:</span> <a href="../interfaces/ClusterTime.html" class="tsd-signature-type" data-tsd-kind="Interface">ClusterTime</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L107">src/sessions.ts:107</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="defaultTransactionOptions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">default<wbr/>Transaction<wbr/>Options<a href="#defaultTransactionOptions" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">default<wbr/>Transaction<wbr/>Options<span class="tsd-signature-symbol">:</span> <a href="../interfaces/TransactionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">TransactionOptions</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L112">src/sessions.ts:112</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="explicit" class="tsd-anchor"></a><h3 class="tsd-anchor-link">explicit<a href="#explicit" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">explicit<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L109">src/sessions.ts:109</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="hasEnded" class="tsd-anchor"></a><h3 class="tsd-anchor-link">has<wbr/>Ended<a href="#hasEnded" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">has<wbr/>Ended<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L104">src/sessions.ts:104</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="operationTime" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagOptional">Optional</span> operation<wbr/>Time<a href="#operationTime" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">operation<wbr/>Time<span class="tsd-signature-symbol">?:</span> <a href="BSON.Timestamp.html" class="tsd-signature-type" data-tsd-kind="Class">Timestamp</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L108">src/sessions.ts:108</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="supports" class="tsd-anchor"></a><h3 class="tsd-anchor-link">supports<a href="#supports" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">supports<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>causalConsistency<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L106">src/sessions.ts:106</a></li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5>causal<wbr/>Consistency<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="transaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link">transaction<a href="#transaction" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">transaction<span class="tsd-signature-symbol">:</span> <a href="Transaction.html" class="tsd-signature-type" data-tsd-kind="Class">Transaction</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L113">src/sessions.ts:113</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="captureRejectionSymbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> capture<wbr/>Rejection<wbr/>Symbol<a href="#captureRejectionSymbol" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">capture<wbr/>Rejection<wbr/>Symbol<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a class="tsd-signature-type" data-tsd-kind="Property">captureRejectionSymbol</a></div><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#captureRejectionSymbol">captureRejectionSymbol</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:328</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="captureRejections" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> capture<wbr/>Rejections<a href="#captureRejections" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">capture<wbr/>Rejections<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#captureRejections">captureRejections</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:333</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Sets or gets the default captureRejection value for all emitters.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="defaultMaxListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> default<wbr/>Max<wbr/>Listeners<a href="#defaultMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">default<wbr/>Max<wbr/>Listeners<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#defaultMaxListeners">defaultMaxListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:334</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="errorMonitor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> error<wbr/>Monitor<a href="#errorMonitor" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">error<wbr/>Monitor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">errorMonitor</span></div><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#errorMonitor">errorMonitor</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:327</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>This symbol shall be used to install a listener for only monitoring <code>'error'</code>
events. Listeners installed using this symbol are called before the regular
<code>'error'</code> listeners are called.</p>
</div><div><p>Installing a listener using this symbol does not change the behavior once an
<code>'error'</code> event is emitted, therefore the process will still crash if no
regular <code>'error'</code> listener is installed.</p>
</div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Accessors</h2><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="id" class="tsd-anchor"></a><h3 class="tsd-anchor-link">id<a href="#id" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> id<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../modules.html#ServerSessionId" class="tsd-signature-type" data-tsd-kind="Type alias">ServerSessionId</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L186">src/sessions.ts:186</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>The server id associated with this session</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../modules.html#ServerSessionId" class="tsd-signature-type" data-tsd-kind="Type alias">ServerSessionId</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="isPinned" class="tsd-anchor"></a><h3 class="tsd-anchor-link">is<wbr/>Pinned<a href="#isPinned" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> isPinned<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L241">src/sessions.ts:241</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="loadBalanced" class="tsd-anchor"></a><h3 class="tsd-anchor-link">load<wbr/>Balanced<a href="#loadBalanced" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> loadBalanced<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L210">src/sessions.ts:210</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="serverSession" class="tsd-anchor"></a><h3 class="tsd-anchor-link">server<wbr/>Session<a href="#serverSession" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> serverSession<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ServerSession.html" class="tsd-signature-type" data-tsd-kind="Class">ServerSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L190">src/sessions.ts:190</a></li></ul></aside><h4 class="tsd-returns-title">Returns <a href="ServerSession.html" class="tsd-signature-type" data-tsd-kind="Class">ServerSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="snapshotEnabled" class="tsd-anchor"></a><h3 class="tsd-anchor-link">snapshot<wbr/>Enabled<a href="#snapshotEnabled" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> snapshotEnabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L206">src/sessions.ts:206</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Whether or not this session is configured for snapshot reads</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="abortTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link">abort<wbr/>Transaction<a href="#abortTransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">abort<wbr/>Transaction<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L417">src/sessions.ts:417</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Aborts the currently active transaction in this session.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="addListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link">add<wbr/>Listener<a href="#addListener" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">add<wbr/>Listener<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">add<wbr/>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">add<wbr/>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#addListener">addListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L318">src/mongo_types.ts:318</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span></h5></li><li><h5>listener: <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#addListener">addListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L319">src/mongo_types.ts:319</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a></h5></li><li><h5>listener: <span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#addListener">addListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L323">src/mongo_types.ts:323</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="advanceClusterTime" class="tsd-anchor"></a><h3 class="tsd-anchor-link">advance<wbr/>Cluster<wbr/>Time<a href="#advanceClusterTime" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">advance<wbr/>Cluster<wbr/>Time<span class="tsd-signature-symbol">(</span>clusterTime<span class="tsd-signature-symbol">: </span><a href="../interfaces/ClusterTime.html" class="tsd-signature-type" data-tsd-kind="Interface">ClusterTime</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L298">src/sessions.ts:298</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>clusterTime: <a href="../interfaces/ClusterTime.html" class="tsd-signature-type" data-tsd-kind="Interface">ClusterTime</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the $clusterTime returned by the server from another session in the form of a document containing the <code>BSON.Timestamp</code> clusterTime and signature</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="advanceOperationTime" class="tsd-anchor"></a><h3 class="tsd-anchor-link">advance<wbr/>Operation<wbr/>Time<a href="#advanceOperationTime" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">advance<wbr/>Operation<wbr/>Time<span class="tsd-signature-symbol">(</span>operationTime<span class="tsd-signature-symbol">: </span><a href="BSON.Timestamp.html" class="tsd-signature-type" data-tsd-kind="Class">Timestamp</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L282">src/sessions.ts:282</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Advances the operationTime for a ClientSession.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>operationTime: <a href="BSON.Timestamp.html" class="tsd-signature-type" data-tsd-kind="Class">Timestamp</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the <code>BSON.Timestamp</code> of the operation type it is desired to advance to</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="commitTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link">commit<wbr/>Transaction<a href="#commitTransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">commit<wbr/>Transaction<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L410">src/sessions.ts:410</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Commits the currently active transaction in this session.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="emit" class="tsd-anchor"></a><h3 class="tsd-anchor-link">emit<a href="#emit" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">emit<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span>, <span class="tsd-signature-symbol">...</span>args<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Parameters</span><span class="tsd-signature-symbol"><</span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#emit">emit</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L365">src/mongo_types.ts:365</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span></h5></li><li><h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>args: <span class="tsd-signature-type">Parameters</span><span class="tsd-signature-symbol"><</span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="endSession" class="tsd-anchor"></a><h3 class="tsd-anchor-link">end<wbr/>Session<a href="#endSession" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">end<wbr/>Session<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/EndSessionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">EndSessionOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L250">src/sessions.ts:250</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Ends this session on the server</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/EndSessionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">EndSessionOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional settings. Currently reserved for future use</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="equals" class="tsd-anchor"></a><h3 class="tsd-anchor-link">equals<a href="#equals" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">equals<span class="tsd-signature-symbol">(</span>session<span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L327">src/sessions.ts:327</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Used to determine if this session equals another</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>session: <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The session to compare to</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="eventNames" class="tsd-anchor"></a><h3 class="tsd-anchor-link">event<wbr/>Names<a href="#eventNames" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">event<wbr/>Names<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#eventNames">eventNames</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L391">src/mongo_types.ts:391</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="getMaxListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Max<wbr/>Listeners<a href="#getMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">get<wbr/>Max<wbr/>Listeners<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#getMaxListeners">getMaxListeners</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L392">src/mongo_types.ts:392</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="inTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link">in<wbr/>Transaction<a href="#inTransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">in<wbr/>Transaction<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L352">src/sessions.ts:352</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><div><p>whether this session is currently in a transaction or not</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="incrementTransactionNumber" class="tsd-anchor"></a><h3 class="tsd-anchor-link">increment<wbr/>Transaction<wbr/>Number<a href="#incrementTransactionNumber" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">increment<wbr/>Transaction<wbr/>Number<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L347">src/sessions.ts:347</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Increment the transaction number on the internal ServerSession</p>
</div><dl class="tsd-comment-tags"><dt>privateremarks</dt><dd><p>This helper increments a value stored on the client session that will be
added to the serverSession's txnNumber upon applying it to a command.
This is because the serverSession is lazily acquired after a connection is obtained</p>
</dd></dl></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="listenerCount" class="tsd-anchor"></a><h3 class="tsd-anchor-link">listener<wbr/>Count<a href="#listenerCount" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">listener<wbr/>Count<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#listenerCount">listenerCount</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L370">src/mongo_types.ts:370</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>type: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventKey</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="listeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link">listeners<a href="#listeners" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">listeners<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#listeners">listeners</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L357">src/mongo_types.ts:357</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="off" class="tsd-anchor"></a><h3 class="tsd-anchor-link">off<a href="#off" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">off<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#off">off</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L346">src/mongo_types.ts:346</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span></h5></li><li><h5>listener: <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#off">off</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L347">src/mongo_types.ts:347</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a></h5></li><li><h5>listener: <span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#off">off</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L351">src/mongo_types.ts:351</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="on" class="tsd-anchor"></a><h3 class="tsd-anchor-link">on<a href="#on" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EventKey</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#on">on</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L325">src/mongo_types.ts:325</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">EventKey</span></h5></li><li><h5>listener: <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#on">on</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L326">src/mongo_types.ts:326</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a></h5></li><li><h5>listener: <span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#on">on</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L330">src/mongo_types.ts:330</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="once" class="tsd-anchor"></a><h3 class="tsd-anchor-link">once<a href="#once" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#once">once</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L332">src/mongo_types.ts:332</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span></h5></li><li><h5>listener: <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#once">once</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L333">src/mongo_types.ts:333</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a></h5></li><li><h5>listener: <span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#once">once</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L337">src/mongo_types.ts:337</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="prependListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link">prepend<wbr/>Listener<a href="#prependListener" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">prepend<wbr/>Listener<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">prepend<wbr/>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">prepend<wbr/>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#prependListener">prependListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L374">src/mongo_types.ts:374</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span></h5></li><li><h5>listener: <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#prependListener">prependListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L375">src/mongo_types.ts:375</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a></h5></li><li><h5>listener: <span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#prependListener">prependListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L379">src/mongo_types.ts:379</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="prependOnceListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link">prepend<wbr/>Once<wbr/>Listener<a href="#prependOnceListener" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">prepend<wbr/>Once<wbr/>Listener<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EventKey</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">prepend<wbr/>Once<wbr/>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">prepend<wbr/>Once<wbr/>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L381">src/mongo_types.ts:381</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">EventKey</span></h5></li><li><h5>listener: <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L385">src/mongo_types.ts:385</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a></h5></li><li><h5>listener: <span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L389">src/mongo_types.ts:389</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="rawListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link">raw<wbr/>Listeners<a href="#rawListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">raw<wbr/>Listeners<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#rawListeners">rawListeners</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L361">src/mongo_types.ts:361</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventKey</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="removeAllListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link">remove<wbr/>All<wbr/>Listeners<a href="#removeAllListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">remove<wbr/>All<wbr/>Listeners<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#removeAllListeners">removeAllListeners</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L353">src/mongo_types.ts:353</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventKey</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a id="removeListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link">remove<wbr/>Listener<a href="#removeListener" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">remove<wbr/>Listener<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">EventKey</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EventKey</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">remove<wbr/>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li><li class="tsd-signature tsd-kind-icon">remove<wbr/>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#removeListener">removeListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L339">src/mongo_types.ts:339</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>EventKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ended"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">EventKey</span></h5></li><li><h5>listener: <a href="../modules.html#ClientSessionEvents" class="tsd-signature-type" data-tsd-kind="Type alias">ClientSessionEvents</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">EventKey</span><span class="tsd-signature-symbol">]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#removeListener">removeListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L340">src/mongo_types.ts:340</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <a href="../modules.html#CommonEvents" class="tsd-signature-type" data-tsd-kind="Type alias">CommonEvents</a></h5></li><li><h5>listener: <span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, listener<span class="tsd-signature-symbol">: </span><a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#removeListener">removeListener</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L344">src/mongo_types.ts:344</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5>listener: <a href="../modules.html#GenericListener" class="tsd-signature-type" data-tsd-kind="Type alias">GenericListener</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="setMaxListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link">set<wbr/>Max<wbr/>Listeners<a href="#setMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">set<wbr/>Max<wbr/>Listeners<span class="tsd-signature-symbol">(</span>n<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#setMaxListeners">setMaxListeners</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/mongo_types.ts#L393">src/mongo_types.ts:393</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>n: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ClientSession.html" class="tsd-signature-type" data-tsd-kind="Class">ClientSession</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="startTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link">start<wbr/>Transaction<a href="#startTransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">start<wbr/>Transaction<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/TransactionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">TransactionOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L361">src/sessions.ts:361</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Starts a new transaction with the given options.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/TransactionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">TransactionOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Options for the transaction</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="toBSON" class="tsd-anchor"></a><h3 class="tsd-anchor-link">toBSON<a href="#toBSON" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">toBSON<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L424">src/sessions.ts:424</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>This is here to ensure that ClientSession is never serialized to BSON.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">never</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a id="withTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link">with<wbr/>Transaction<a href="#withTransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">with<wbr/>Transaction<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>fn<span class="tsd-signature-symbol">: </span><a href="../modules.html#WithTransactionCallback" class="tsd-signature-type" data-tsd-kind="Type alias">WithTransactionCallback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/TransactionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">TransactionOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/sessions.ts#L449">src/sessions.ts:449</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Runs a provided callback within a transaction, retrying either the commitTransaction operation
or entire transaction as needed (and when the error permits) to better ensure that
the transaction can complete successfully.</p>
</div><div><p><strong>IMPORTANT:</strong> This method requires the user to return a Promise, and <code>await</code> all operations.
Any callbacks that do not return a Promise will result in undefined behavior.</p>
</div><dl class="tsd-comment-tags"><dt>remarks</dt><dd><p>This function:</p>
<ul>
<li>Will return the command response from the final commitTransaction if every operation is successful (can be used as a truthy object)</li>
<li>Will return <code>undefined</code> if the transaction is explicitly aborted with <code>await session.abortTransaction()</code></li>
<li>Will throw if one of the operations throws or <code>throw</code> statement is used inside the <code>withTransaction</code> callback</li>
</ul>
<p>Checkout a descriptive example here:</p>
</dd><dt>see</dt><dd><p><a href="https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions">https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions</a></p>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>T = <span class="tsd-signature-type">void</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>fn: <a href="../modules.html#WithTransactionCallback" class="tsd-signature-type" data-tsd-kind="Type alias">WithTransactionCallback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>callback to run within a transaction</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/TransactionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">TransactionOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>optional settings for the transaction</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4><div><p>A raw command response or undefined</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="getEventListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> get<wbr/>Event<wbr/>Listeners<a href="#getEventListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><li class="tsd-signature tsd-kind-icon">get<wbr/>Event<wbr/>Listeners<span class="tsd-signature-symbol">(</span>emitter<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">_DOMEventTarget</span>, name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#getEventListeners">getEventListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:299</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>
</div><div><p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.listeners</code> on
the emitter.</p>
<p>For <code>EventTarget</code>s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> { </span><span class="hl-4">getEventListeners</span><span class="hl-0">, </span><span class="hl-4">EventEmitter</span><span class="hl-0"> } = </span><span class="hl-2">require</span><span class="hl-0">(</span><span class="hl-5">'events'</span><span class="hl-0">);</span><br/><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">ee</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-2">listener</span><span class="hl-0"> = () </span><span class="hl-3">=></span><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-5">'Events are fun'</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-6">ee</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-5">'foo'</span><span class="hl-0">, </span><span class="hl-6">listener</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-2">getEventListeners</span><span class="hl-0">(</span><span class="hl-6">ee</span><span class="hl-0">, </span><span class="hl-5">'foo'</span><span class="hl-0">); </span><span class="hl-1">// [listener]</span><br/><span class="hl-0">}</span><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">et</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">EventTarget</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-2">listener</span><span class="hl-0"> = () </span><span class="hl-3">=></span><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-5">'Events are fun'</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-6">et</span><span class="hl-0">.</span><span class="hl-2">addEventListener</span><span class="hl-0">(</span><span class="hl-5">'foo'</span><span class="hl-0">, </span><span class="hl-6">listener</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-2">getEventListeners</span><span class="hl-0">(</span><span class="hl-6">et</span><span class="hl-0">, </span><span class="hl-5">'foo'</span><span class="hl-0">); </span><span class="hl-1">// [listener]</span><br/><span class="hl-0">}</span>
</code></pre>
</div><dl class="tsd-comment-tags"><dt>since</dt><dd><p>v15.2.0, v14.17.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>emitter: <span class="tsd-signature-type">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">_DOMEventTarget</span></h5></li><li><h5>name: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="listenerCount-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> listener<wbr/>Count<a href="#listenerCount-1" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><li class="tsd-signature tsd-kind-icon">listener<wbr/>Count<span class="tsd-signature-symbol">(</span>emitter<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EventEmitter</span>, eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#listenerCount-1">listenerCount</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:271</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>A class method that returns the number of listeners for the given <code>eventName</code>registered on the given <code>emitter</code>.</p>
</div><div><pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> { </span><span class="hl-4">EventEmitter</span><span class="hl-0">, </span><span class="hl-4">listenerCount</span><span class="hl-0"> } = </span><span class="hl-2">require</span><span class="hl-0">(</span><span class="hl-5">'events'</span><span class="hl-0">);</span><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">myEmitter</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-6">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-5">'event'</span><span class="hl-0">, () </span><span class="hl-3">=></span><span class="hl-0"> {});</span><br/><span class="hl-6">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-5">'event'</span><span class="hl-0">, () </span><span class="hl-3">=></span><span class="hl-0"> {});</span><br/><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">listenerCount</span><span class="hl-0">(</span><span class="hl-6">myEmitter</span><span class="hl-0">, </span><span class="hl-5">'event'</span><span class="hl-0">));</span><br/><span class="hl-1">// Prints: 2</span>
</code></pre>
</div><dl class="tsd-comment-tags"><dt>since</dt><dd><p>v0.9.12</p>
</dd><dt>deprecated</dt><dd><p>Since v3.2.0 - Use <code>listenerCount</code> instead.</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>emitter: <span class="tsd-signature-type">EventEmitter</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The emitter to query</p>
</div></div></li><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The event name</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="on-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> on<a href="#on-1" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>emitter<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EventEmitter</span>, eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">StaticEventEmitterOptions</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AsyncIterableIterator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#on-1">on</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:254</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> { </span><span class="hl-4">on</span><span class="hl-0">, </span><span class="hl-4">EventEmitter</span><span class="hl-0"> } = </span><span class="hl-2">require</span><span class="hl-0">(</span><span class="hl-5">'events'</span><span class="hl-0">);</span>
</code></pre>
</div><div><p>(async () => {
const ee = new EventEmitter();</p>
<p> // Emit later on
process.nextTick(() => {
ee.emit('foo', 'bar');
ee.emit('foo', 42);
});</p>
<p> for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
console.log(event); // prints ['bar'] [42]
}
// Unreachable here
})();</p>
<pre><code><br/><span class="hl-6">Returns</span><span class="hl-0"> </span><span class="hl-6">an</span><span class="hl-0"> </span><span class="hl-5">`AsyncIterator`</span><span class="hl-0"> </span><span class="hl-6">that</span><span class="hl-0"> </span><span class="hl-6">iterates</span><span class="hl-0"> </span><span class="hl-5">`eventName`</span><span class="hl-0"> </span><span class="hl-6">events</span><span class="hl-0">. </span><span class="hl-6">It</span><span class="hl-0"> </span><span class="hl-6">will</span><span class="hl-0"> </span><span class="hl-7">throw</span><br/><span class="hl-7">if</span><span class="hl-0"> </span><span class="hl-6">the</span><span class="hl-0"> </span><span class="hl-5">`EventEmitter`</span><span class="hl-0"> </span><span class="hl-6">emits</span><span class="hl-0"> </span><span class="hl-5">`'error'`</span><span class="hl-0">. </span><span class="hl-6">It</span><span class="hl-0"> </span><span class="hl-6">removes</span><span class="hl-0"> </span><span class="hl-6">all</span><span class="hl-0"> </span><span class="hl-6">listeners</span><span class="hl-0"> </span><span class="hl-6">when</span><br/><span class="hl-6">exiting</span><span class="hl-0"> </span><span class="hl-6">the</span><span class="hl-0"> </span><span class="hl-6">loop</span><span class="hl-0">. </span><span class="hl-6">The</span><span class="hl-0"> </span><span class="hl-5">`value`</span><span class="hl-0"> </span><span class="hl-6">returned</span><span class="hl-0"> </span><span class="hl-6">by</span><span class="hl-0"> </span><span class="hl-6">each</span><span class="hl-0"> </span><span class="hl-6">iteration</span><span class="hl-0"> </span><span class="hl-6">is</span><span class="hl-0"> </span><span class="hl-6">an</span><span class="hl-0"> </span><span class="hl-6">array</span><br/><span class="hl-6">composed</span><span class="hl-0"> </span><span class="hl-3">of</span><span class="hl-0"> </span><span class="hl-6">the</span><span class="hl-0"> </span><span class="hl-6">emitted</span><span class="hl-0"> </span><span class="hl-6">event</span><span class="hl-0"> </span><span class="hl-3">arguments</span><span class="hl-0">.</span><br/><br/><span class="hl-6">An</span><span class="hl-0"> </span><span class="hl-5">`AbortSignal`</span><span class="hl-0"> </span><span class="hl-6">can</span><span class="hl-0"> </span><span class="hl-6">be</span><span class="hl-0"> </span><span class="hl-6">used</span><span class="hl-0"> </span><span class="hl-6">to</span><span class="hl-0"> </span><span class="hl-6">cancel</span><span class="hl-0"> </span><span class="hl-6">waiting</span><span class="hl-0"> </span><span class="hl-6">on</span><span class="hl-0"> </span><span class="hl-10">events</span><span class="hl-0">:</span><br/><br/><span class="hl-5">```js</span><br/><span class="hl-5">const { on, EventEmitter } = require('events');</span><br/><span class="hl-5">const ac = new AbortController();</span><br/><br/><span class="hl-5">(async () => {</span><br/><span class="hl-5"> const ee = new EventEmitter();</span><br/><br/><span class="hl-5"> // Emit later on</span><br/><span class="hl-5"> process.nextTick(() => {</span><br/><span class="hl-5"> ee.emit('foo', 'bar');</span><br/><span class="hl-5"> ee.emit('foo', 42);</span><br/><span class="hl-5"> });</span><br/><br/><span class="hl-5"> for await (const event of on(ee, 'foo', { signal: ac.signal })) {</span><br/><span class="hl-5"> // The execution of this inner block is synchronous and it</span><br/><span class="hl-5"> // processes one event at a time (even with await). Do not use</span><br/><span class="hl-5"> // if concurrent execution is required.</span><br/><span class="hl-5"> console.log(event); // prints ['bar'] [42]</span><br/><span class="hl-5"> }</span><br/><span class="hl-5"> // Unreachable here</span><br/><span class="hl-5">})();</span><br/><br/><span class="hl-5">process.nextTick(() => ac.abort());</span>
</code></pre>
</div><dl class="tsd-comment-tags"><dt>since</dt><dd><p>v13.6.0, v12.16.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>emitter: <span class="tsd-signature-type">EventEmitter</span></h5></li><li><h5>eventName: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The name of the event being listened for</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">StaticEventEmitterOptions</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncIterableIterator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><div><p>that iterates <code>eventName</code> events emitted by the <code>emitter</code></p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="once-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> once<a href="#once-1" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>emitter<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">_NodeEventTarget</span>, eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">StaticEventEmitterOptions</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">once<span class="tsd-signature-symbol">(</span>emitter<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">_DOMEventTarget</span>, eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">StaticEventEmitterOptions</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#once-1">once</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:194</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Creates a <code>Promise</code> that is fulfilled when the <code>EventEmitter</code> emits the given
event or that is rejected if the <code>EventEmitter</code> emits <code>'error'</code> while waiting.
The <code>Promise</code> will resolve with an array of all the arguments emitted to the
given event.</p>
</div><div><p>This method is intentionally generic and works with the web platform <a href="https://dom.spec.whatwg.org/#interface-eventtarget">EventTarget</a> interface, which has no special<code>'error'</code> event
semantics and does not listen to the <code>'error'</code> event.</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> { </span><span class="hl-4">once</span><span class="hl-0">, </span><span class="hl-4">EventEmitter</span><span class="hl-0"> } = </span><span class="hl-2">require</span><span class="hl-0">(</span><span class="hl-5">'events'</span><span class="hl-0">);</span><br/><br/><span class="hl-3">async</span><span class="hl-0"> </span><span class="hl-3">function</span><span class="hl-0"> </span><span class="hl-2">run</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">ee</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-0"> </span><span class="hl-6">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-3">=></span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-6">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-5">'myevent'</span><span class="hl-0">, </span><span class="hl-8">42</span><span class="hl-0">);</span><br/><span class="hl-0"> });</span><br/><br/><span class="hl-0"> </span><span class="hl-3">const</span><span class="hl-0"> [</span><span class="hl-4">value</span><span class="hl-0">] = </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">ee</span><span class="hl-0">, </span><span class="hl-5">'myevent'</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">value</span><span class="hl-0">);</span><br/><br/><span class="hl-0"> </span><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">err</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-9">Error</span><span class="hl-0">(</span><span class="hl-5">'kaboom'</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-6">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-3">=></span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-6">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-5">'error'</span><span class="hl-0">, </span><span class="hl-6">err</span><span class="hl-0">);</span><br/><span class="hl-0"> });</span><br/><br/><span class="hl-0"> </span><span class="hl-7">try</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">ee</span><span class="hl-0">, </span><span class="hl-5">'myevent'</span><span class="hl-0">);</span><br/><span class="hl-0"> } </span><span class="hl-7">catch</span><span class="hl-0"> (</span><span class="hl-6">err</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-5">'error happened'</span><span class="hl-0">, </span><span class="hl-6">err</span><span class="hl-0">);</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-2">run</span><span class="hl-0">();</span>
</code></pre>
<p>The special handling of the <code>'error'</code> event is only used when <code>events.once()</code>is used to wait for another event. If <code>events.once()</code> is used to wait for the
'<code>error'</code> event itself, then it is treated as any other kind of event without
special handling:</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> { </span><span class="hl-4">EventEmitter</span><span class="hl-0">, </span><span class="hl-4">once</span><span class="hl-0"> } = </span><span class="hl-2">require</span><span class="hl-0">(</span><span class="hl-5">'events'</span><span class="hl-0">);</span><br/><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">ee</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">ee</span><span class="hl-0">, </span><span class="hl-5">'error'</span><span class="hl-0">)</span><br/><span class="hl-0"> .</span><span class="hl-2">then</span><span class="hl-0">(([</span><span class="hl-6">err</span><span class="hl-0">]) </span><span class="hl-3">=></span><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-5">'ok'</span><span class="hl-0">, </span><span class="hl-6">err</span><span class="hl-0">.</span><span class="hl-6">message</span><span class="hl-0">))</span><br/><span class="hl-0"> .</span><span class="hl-2">catch</span><span class="hl-0">((</span><span class="hl-6">err</span><span class="hl-0">) </span><span class="hl-3">=></span><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-5">'error'</span><span class="hl-0">, </span><span class="hl-6">err</span><span class="hl-0">.</span><span class="hl-6">message</span><span class="hl-0">));</span><br/><br/><span class="hl-6">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-5">'error'</span><span class="hl-0">, </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-9">Error</span><span class="hl-0">(</span><span class="hl-5">'boom'</span><span class="hl-0">));</span><br/><br/><span class="hl-1">// Prints: ok boom</span>
</code></pre>
<p>An <code>AbortSignal</code> can be used to cancel waiting for the event:</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> { </span><span class="hl-4">EventEmitter</span><span class="hl-0">, </span><span class="hl-4">once</span><span class="hl-0"> } = </span><span class="hl-2">require</span><span class="hl-0">(</span><span class="hl-5">'events'</span><span class="hl-0">);</span><br/><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">ee</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">ac</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">AbortController</span><span class="hl-0">();</span><br/><br/><span class="hl-3">async</span><span class="hl-0"> </span><span class="hl-3">function</span><span class="hl-0"> </span><span class="hl-2">foo</span><span class="hl-0">(</span><span class="hl-6">emitter</span><span class="hl-0">, </span><span class="hl-6">event</span><span class="hl-0">, </span><span class="hl-6">signal</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-7">try</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">emitter</span><span class="hl-0">, </span><span class="hl-6">event</span><span class="hl-0">, { </span><span class="hl-6">signal</span><span class="hl-0"> });</span><br/><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-5">'event emitted!'</span><span class="hl-0">);</span><br/><span class="hl-0"> } </span><span class="hl-7">catch</span><span class="hl-0"> (</span><span class="hl-6">error</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-7">if</span><span class="hl-0"> (</span><span class="hl-6">error</span><span class="hl-0">.</span><span class="hl-6">name</span><span class="hl-0"> === </span><span class="hl-5">'AbortError'</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-5">'Waiting for the event was canceled!'</span><span class="hl-0">);</span><br/><span class="hl-0"> } </span><span class="hl-7">else</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-5">'There was an error'</span><span class="hl-0">, </span><span class="hl-6">error</span><span class="hl-0">.</span><span class="hl-6">message</span><span class="hl-0">);</span><br/><span class="hl-0"> }</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-2">foo</span><span class="hl-0">(</span><span class="hl-6">ee</span><span class="hl-0">, </span><span class="hl-5">'foo'</span><span class="hl-0">, </span><span class="hl-6">ac</span><span class="hl-0">.</span><span class="hl-6">signal</span><span class="hl-0">);</span><br/><span class="hl-6">ac</span><span class="hl-0">.</span><span class="hl-2">abort</span><span class="hl-0">(); </span><span class="hl-1">// Abort waiting for the event</span><br/><span class="hl-6">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-5">'foo'</span><span class="hl-0">); </span><span class="hl-1">// Prints: Waiting for the event was canceled!</span>
</code></pre>
</div><dl class="tsd-comment-tags"><dt>since</dt><dd><p>v11.13.0, v10.16.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>emitter: <span class="tsd-signature-type">_NodeEventTarget</span></h5></li><li><h5>eventName: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">StaticEventEmitterOptions</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#once-1">once</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:195</li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>emitter: <span class="tsd-signature-type">_DOMEventTarget</span></h5></li><li><h5>eventName: <span class="tsd-signature-type">string</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">StaticEventEmitterOptions</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="setMaxListeners-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> set<wbr/>Max<wbr/>Listeners<a href="#setMaxListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><li class="tsd-signature tsd-kind-icon">set<wbr/>Max<wbr/>Listeners<span class="tsd-signature-symbol">(</span>n<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, <span class="tsd-signature-symbol">...</span>eventTargets<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-type">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">_DOMEventTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="TypedEventEmitter.html">TypedEventEmitter</a>.<a href="TypedEventEmitter.html#setMaxListeners-1">setMaxListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:317</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-4">setMaxListeners</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-4">EventEmitter</span><br/><span class="hl-0">} = </span><span class="hl-2">require</span><span class="hl-0">(</span><span class="hl-5">'events'</span><span class="hl-0">);</span>
</code></pre>
</div><div><p>const target = new EventTarget();
const emitter = new EventEmitter();</p>
<p>setMaxListeners(5, target, emitter);
```</p>
</div><dl class="tsd-comment-tags"><dt>since</dt><dd><p>v15.4.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> n: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>A non-negative number. The maximum number of listeners per <code>EventTarget</code> event.</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>eventTargets: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-type">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">_DOMEventTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li><li class="label tsd-is-external"><span>Internals</span></li><li class="label tsd-is-external"><span>Externals</span></li><li class=" tsd-kind-namespace tsd-is-external"><a href="../modules/BSON.html">BSON</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="ClientSession.html" class="tsd-kind-icon">Client<wbr/>Session</a><ul><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#clientOptions" class="tsd-kind-icon">client<wbr/>Options</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#clusterTime" class="tsd-kind-icon">cluster<wbr/>Time</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#defaultTransactionOptions" class="tsd-kind-icon">default<wbr/>Transaction<wbr/>Options</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#explicit" class="tsd-kind-icon">explicit</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#hasEnded" class="tsd-kind-icon">has<wbr/>Ended</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#operationTime" class="tsd-kind-icon">operation<wbr/>Time</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#supports" class="tsd-kind-icon">supports</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ClientSession.html#transaction" class="tsd-kind-icon">transaction</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#captureRejectionSymbol" class="tsd-kind-icon">capture<wbr/>Rejection<wbr/>Symbol</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#captureRejections" class="tsd-kind-icon">capture<wbr/>Rejections</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#defaultMaxListeners" class="tsd-kind-icon">default<wbr/>Max<wbr/>Listeners</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#errorMonitor" class="tsd-kind-icon">error<wbr/>Monitor</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#isPinned" class="tsd-kind-icon">is<wbr/>Pinned</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#loadBalanced" class="tsd-kind-icon">load<wbr/>Balanced</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#serverSession" class="tsd-kind-icon">server<wbr/>Session</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ClientSession.html#snapshotEnabled" class="tsd-kind-icon">snapshot<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#abortTransaction" class="tsd-kind-icon">abort<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#addListener" class="tsd-kind-icon">add<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#advanceClusterTime" class="tsd-kind-icon">advance<wbr/>Cluster<wbr/>Time</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#advanceOperationTime" class="tsd-kind-icon">advance<wbr/>Operation<wbr/>Time</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#commitTransaction" class="tsd-kind-icon">commit<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#emit" class="tsd-kind-icon">emit</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#endSession" class="tsd-kind-icon">end<wbr/>Session</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#equals" class="tsd-kind-icon">equals</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="ClientSession.html#eventNames" class="tsd-kind-icon">event<wbr/>Names</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="ClientSession.html#getMaxListeners" class="tsd-kind-icon">get<wbr/>Max<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#inTransaction" class="tsd-kind-icon">in<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#incrementTransactionNumber" class="tsd-kind-icon">increment<wbr/>Transaction<wbr/>Number</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#listenerCount" class="tsd-kind-icon">listener<wbr/>Count</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#listeners" class="tsd-kind-icon">listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#off" class="tsd-kind-icon">off</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#on" class="tsd-kind-icon">on</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#once" class="tsd-kind-icon">once</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#prependListener" class="tsd-kind-icon">prepend<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#prependOnceListener" class="tsd-kind-icon">prepend<wbr/>Once<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#rawListeners" class="tsd-kind-icon">raw<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#removeAllListeners" class="tsd-kind-icon">remove<wbr/>All<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="ClientSession.html#removeListener" class="tsd-kind-icon">remove<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="ClientSession.html#setMaxListeners" class="tsd-kind-icon">set<wbr/>Max<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#startTransaction" class="tsd-kind-icon">start<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ClientSession.html#toBSON" class="tsd-kind-icon">toBSON</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="ClientSession.html#withTransaction" class="tsd-kind-icon">with<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#getEventListeners" class="tsd-kind-icon">get<wbr/>Event<wbr/>Listeners</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#listenerCount-1" class="tsd-kind-icon">listener<wbr/>Count</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#on-1" class="tsd-kind-icon">on</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#once-1" class="tsd-kind-icon">once</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="ClientSession.html#setMaxListeners-1" class="tsd-kind-icon">set<wbr/>Max<wbr/>Listeners</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>