-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathindex.html
242 lines (221 loc) · 79.1 KB
/
index.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>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><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"><h1>mongodb</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><div class="tsd-panel tsd-typography">
<a href="#mongodb-nodejs-driver" id="mongodb-nodejs-driver" style="color: inherit; text-decoration: none;">
<h1>MongoDB NodeJS Driver</h1>
</a>
<p>The official <a href="https://www.mongodb.com/">MongoDB</a> driver for Node.js.</p>
<p><strong>Upgrading to version 4? Take a look at our <a href="https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_4.0.0.md">upgrade guide here</a>!</strong></p>
<a href="#quick-links" id="quick-links" style="color: inherit; text-decoration: none;">
<h2>Quick Links</h2>
</a>
<table>
<thead>
<tr>
<th>what</th>
<th>where</th>
</tr>
</thead>
<tbody><tr>
<td>documentation</td>
<td><a href="https://www.mongodb.com/docs/drivers/node">docs.mongodb.com/drivers/node</a></td>
</tr>
<tr>
<td>api-doc</td>
<td><a href="https://mongodb.github.io/node-mongodb-native/4.1/">mongodb.github.io/node-mongodb-native/4.1/</a></td>
</tr>
<tr>
<td>npm package</td>
<td><a href="https://www.npmjs.com/package/mongodb">www.npmjs.com/package/mongodb</a></td>
</tr>
<tr>
<td>source</td>
<td><a href="https://github.com/mongodb/node-mongodb-native">github.com/mongodb/node-mongodb-native</a></td>
</tr>
<tr>
<td>mongodb</td>
<td><a href="https://www.mongodb.com">www.mongodb.com</a></td>
</tr>
<tr>
<td>changelog</td>
<td><a href="https://github.com/mongodb/node-mongodb-native/blob/HEAD/HISTORY.md">HISTORY.md</a></td>
</tr>
<tr>
<td>upgrade to v4</td>
<td><a href="https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_4.0.0.md">docs/CHANGES_4.0.0.md</a></td>
</tr>
<tr>
<td>contributing</td>
<td><a href="https://github.com/mongodb/node-mongodb-native/blob/HEAD/CONTRIBUTING.md">CONTRIBUTING.md</a></td>
</tr>
</tbody></table>
<a href="#bugs--feature-requests" id="bugs--feature-requests" style="color: inherit; text-decoration: none;">
<h3>Bugs / Feature Requests</h3>
</a>
<p>Think you’ve found a bug? Want to see a new feature in <code>node-mongodb-native</code>? Please open a
case in our issue management tool, JIRA:</p>
<ul>
<li>Create an account and login <a href="https://jira.mongodb.org">jira.mongodb.org</a>.</li>
<li>Navigate to the NODE project <a href="https://jira.mongodb.org/browse/NODE">jira.mongodb.org/browse/NODE</a>.</li>
<li>Click <strong>Create Issue</strong> - Please provide as much information as possible about the issue type and how to reproduce it.</li>
</ul>
<p>Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the
Core Server (i.e. SERVER) project are <strong>public</strong>.</p>
<a href="#support--feedback" id="support--feedback" style="color: inherit; text-decoration: none;">
<h3>Support / Feedback</h3>
</a>
<p>For issues with, questions about, or feedback for the Node.js driver, please look into our <a href="https://www.mongodb.com/docs/manual/support">support channels</a>. Please do not email any of the driver developers directly with issues or questions - you're more likely to get an answer on the <a href="https://community.mongodb.com/tags/c/drivers-odms-connectors/7/node-js-driver">MongoDB Community Forums</a>.</p>
<a href="#change-log" id="change-log" style="color: inherit; text-decoration: none;">
<h3>Change Log</h3>
</a>
<p>Change history can be found in <a href="https://github.com/mongodb/node-mongodb-native/blob/HEAD/HISTORY.md"><code>HISTORY.md</code></a>.</p>
<a href="#compatibility" id="compatibility" style="color: inherit; text-decoration: none;">
<h3>Compatibility</h3>
</a>
<p>For version compatibility matrices, please refer to the following links:</p>
<ul>
<li><a href="https://www.mongodb.com/docs/drivers/node/current/compatibility/#mongodb-compatibility">MongoDB</a></li>
<li><a href="https://www.mongodb.com/docs/drivers/node/current/compatibility/#language-compatibility">NodeJS</a></li>
</ul>
<a href="#typescript-version" id="typescript-version" style="color: inherit; text-decoration: none;">
<h4>Typescript Version</h4>
</a>
<p>We recommend using the latest version of typescript, however we do provide a <a href="https://github.com/sandersn/downlevel-dts#readme">downleveled</a> version of the type definitions that we test compiling against <code>typescript@4.0.2</code>.
Since typescript <a href="https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes">does not restrict breaking changes to major versions</a> we consider this support best effort.
If you run into any unexpected compiler failures please let us know and we will do our best to correct it.</p>
<a href="#installation" id="installation" style="color: inherit; text-decoration: none;">
<h2>Installation</h2>
</a>
<p>The recommended way to get started using the Node.js 4.x driver is by using the <code>npm</code> (Node Package Manager) to install the dependency in your project.</p>
<p>After you've created your own project using <code>npm init</code>, you can run:</p>
<pre><code class="language-bash"><span class="hl-0">npm install mongodb</span><br/><span class="hl-1"># or ...</span><br/><span class="hl-0">yarn add mongodb</span>
</code></pre>
<p>This will download the MongoDB driver and add a dependency entry in your <code>package.json</code> file.</p>
<p>If you are a Typescript user, you will need the Node.js type definitions to use the driver's definitions:</p>
<pre><code class="language-sh"><span class="hl-0">npm install -D @types/node</span>
</code></pre>
<a href="#troubleshooting" id="troubleshooting" style="color: inherit; text-decoration: none;">
<h2>Troubleshooting</h2>
</a>
<p>The MongoDB driver depends on several other packages. These are:</p>
<ul>
<li><a href="https://github.com/mongodb/js-bson">bson</a></li>
<li><a href="https://github.com/mongodb-js/bson-ext">bson-ext</a></li>
<li><a href="https://github.com/mongodb-js/kerberos">kerberos</a></li>
<li><a href="https://github.com/mongodb/libmongocrypt#readme">mongodb-client-encryption</a></li>
</ul>
<p>Some of these packages include native C++ extensions. Consult the <a href="https://github.com/mongodb/node-mongodb-native/blob/HEAD/docs/native-extensions.md">trouble shooting guide here</a> if you run into issues.</p>
<a href="#quick-start" id="quick-start" style="color: inherit; text-decoration: none;">
<h2>Quick Start</h2>
</a>
<p>This guide will show you how to set up a simple application using Node.js and MongoDB. Its scope is only how to set up the driver and perform the simple CRUD operations. For more in-depth coverage, see the <a href="https://www.mongodb.com/docs/drivers/node/">official documentation</a>.</p>
<a href="#create-the-packagejson-file" id="create-the-packagejson-file" style="color: inherit; text-decoration: none;">
<h3>Create the <code>package.json</code> file</h3>
</a>
<p>First, create a directory where your application will live.</p>
<pre><code class="language-bash"><span class="hl-0">mkdir myProject</span><br/><span class="hl-2">cd</span><span class="hl-0"> myProject</span>
</code></pre>
<p>Enter the following command and answer the questions to create the initial structure for your new project:</p>
<pre><code class="language-bash"><span class="hl-0">npm init -y</span>
</code></pre>
<p>Next, install the driver as a dependency.</p>
<pre><code class="language-bash"><span class="hl-0">npm install mongodb</span>
</code></pre>
<a href="#start-a-mongodb-server" id="start-a-mongodb-server" style="color: inherit; text-decoration: none;">
<h3>Start a MongoDB Server</h3>
</a>
<p>For complete MongoDB installation instructions, see <a href="https://www.mongodb.com/docs/manual/installation/">the manual</a>.</p>
<ol>
<li>Download the right MongoDB version from <a href="https://www.mongodb.org/downloads">MongoDB</a></li>
<li>Create a database directory (in this case under <strong>/data</strong>).</li>
<li>Install and start a <code>mongod</code> process.</li>
</ol>
<pre><code class="language-bash"><span class="hl-0">mongod --dbpath=/data</span>
</code></pre>
<p>You should see the <strong>mongod</strong> process start up and print some status information.</p>
<a href="#connect-to-mongodb" id="connect-to-mongodb" style="color: inherit; text-decoration: none;">
<h3>Connect to MongoDB</h3>
</a>
<p>Create a new <strong>app.js</strong> file and add the following code to try out some basic CRUD
operations using the MongoDB driver.</p>
<p>Add code to connect to the server and the database <strong>myProject</strong>:</p>
<blockquote>
<p><strong>NOTE:</strong> All the examples below use async/await syntax.</p>
<p>However, all async API calls support an optional callback as the final argument,
if a callback is provided a Promise will not be returned.</p>
</blockquote>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> { </span><span class="hl-4">MongoClient</span><span class="hl-0"> } = </span><span class="hl-2">require</span><span class="hl-0">(</span><span class="hl-5">'mongodb'</span><span class="hl-0">);</span><br/><span class="hl-1">// or as an es module:</span><br/><span class="hl-1">// import { MongoClient } from 'mongodb'</span><br/><br/><span class="hl-1">// Connection URL</span><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">url</span><span class="hl-0"> = </span><span class="hl-5">'mongodb://localhost:27017'</span><span class="hl-0">;</span><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">client</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">MongoClient</span><span class="hl-0">(</span><span class="hl-6">url</span><span class="hl-0">);</span><br/><br/><span class="hl-1">// Database Name</span><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">dbName</span><span class="hl-0"> = </span><span class="hl-5">'myProject'</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">main</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-1">// Use connect method to connect to the server</span><br/><span class="hl-0"> </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">client</span><span class="hl-0">.</span><span class="hl-2">connect</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">'Connected successfully to server'</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">db</span><span class="hl-0"> = </span><span class="hl-6">client</span><span class="hl-0">.</span><span class="hl-2">db</span><span class="hl-0">(</span><span class="hl-6">dbName</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">collection</span><span class="hl-0"> = </span><span class="hl-6">db</span><span class="hl-0">.</span><span class="hl-2">collection</span><span class="hl-0">(</span><span class="hl-5">'documents'</span><span class="hl-0">);</span><br/><br/><span class="hl-0"> </span><span class="hl-1">// the following code examples can be pasted here...</span><br/><br/><span class="hl-0"> </span><span class="hl-7">return</span><span class="hl-0"> </span><span class="hl-5">'done.'</span><span class="hl-0">;</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-2">main</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">console</span><span class="hl-0">.</span><span class="hl-6">log</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">console</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-2">finally</span><span class="hl-0">(() </span><span class="hl-3">=></span><span class="hl-0"> </span><span class="hl-6">client</span><span class="hl-0">.</span><span class="hl-2">close</span><span class="hl-0">());</span>
</code></pre>
<p>Run your app from the command line with:</p>
<pre><code class="language-bash"><span class="hl-0">node app.js</span>
</code></pre>
<p>The application should print <strong>Connected successfully to server</strong> to the console.</p>
<a href="#insert-a-document" id="insert-a-document" style="color: inherit; text-decoration: none;">
<h3>Insert a Document</h3>
</a>
<p>Add to <strong>app.js</strong> the following function which uses the <strong>insertMany</strong>
method to add three documents to the <strong>documents</strong> collection.</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">insertResult</span><span class="hl-0"> = </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">collection</span><span class="hl-0">.</span><span class="hl-2">insertMany</span><span class="hl-0">([{ </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">1</span><span class="hl-0"> }, { </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">2</span><span class="hl-0"> }, { </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">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-5">'Inserted documents =>'</span><span class="hl-0">, </span><span class="hl-6">insertResult</span><span class="hl-0">);</span>
</code></pre>
<p>The <strong>insertMany</strong> command returns an object with information about the insert operations.</p>
<a href="#find-all-documents" id="find-all-documents" style="color: inherit; text-decoration: none;">
<h3>Find All Documents</h3>
</a>
<p>Add a query that returns all the documents.</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">findResult</span><span class="hl-0"> = </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">collection</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({}).</span><span class="hl-2">toArray</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-5">'Found documents =>'</span><span class="hl-0">, </span><span class="hl-6">findResult</span><span class="hl-0">);</span>
</code></pre>
<p>This query returns all the documents in the <strong>documents</strong> collection.
If you add this below the insertMany example you'll see the document's you've inserted.</p>
<a href="#find-documents-with-a-query-filter" id="find-documents-with-a-query-filter" style="color: inherit; text-decoration: none;">
<h3>Find Documents with a Query Filter</h3>
</a>
<p>Add a query filter to find only documents which meet the query criteria.</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">filteredDocs</span><span class="hl-0"> = </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">collection</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({ </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">3</span><span class="hl-0"> }).</span><span class="hl-2">toArray</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-5">'Found documents filtered by { a: 3 } =>'</span><span class="hl-0">, </span><span class="hl-6">filteredDocs</span><span class="hl-0">);</span>
</code></pre>
<p>Only the documents which match <code>'a' : 3</code> should be returned.</p>
<a href="#update-a-document" id="update-a-document" style="color: inherit; text-decoration: none;">
<h3>Update a document</h3>
</a>
<p>The following operation updates a document in the <strong>documents</strong> collection.</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">updateResult</span><span class="hl-0"> = </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">collection</span><span class="hl-0">.</span><span class="hl-2">updateOne</span><span class="hl-0">({ </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">3</span><span class="hl-0"> }, { </span><span class="hl-6">$set:</span><span class="hl-0"> { </span><span class="hl-6">b:</span><span class="hl-0"> </span><span class="hl-8">1</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-5">'Updated documents =>'</span><span class="hl-0">, </span><span class="hl-6">updateResult</span><span class="hl-0">);</span>
</code></pre>
<p>The method updates the first document where the field <strong>a</strong> is equal to <strong>3</strong> by adding a new field <strong>b</strong> to the document set to <strong>1</strong>. <code>updateResult</code> contains information about whether there was a matching document to update or not.</p>
<a href="#remove-a-document" id="remove-a-document" style="color: inherit; text-decoration: none;">
<h3>Remove a document</h3>
</a>
<p>Remove the document where the field <strong>a</strong> is equal to <strong>3</strong>.</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">deleteResult</span><span class="hl-0"> = </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">collection</span><span class="hl-0">.</span><span class="hl-2">deleteMany</span><span class="hl-0">({ </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">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-5">'Deleted documents =>'</span><span class="hl-0">, </span><span class="hl-6">deleteResult</span><span class="hl-0">);</span>
</code></pre>
<a href="#index-a-collection" id="index-a-collection" style="color: inherit; text-decoration: none;">
<h3>Index a Collection</h3>
</a>
<p><a href="https://www.mongodb.com/docs/manual/indexes/">Indexes</a> can improve your application's
performance. The following function creates an index on the <strong>a</strong> field in the
<strong>documents</strong> collection.</p>
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">indexName</span><span class="hl-0"> = </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">collection</span><span class="hl-0">.</span><span class="hl-2">createIndex</span><span class="hl-0">({ </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">1</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-5">'index name ='</span><span class="hl-0">, </span><span class="hl-6">indexName</span><span class="hl-0">);</span>
</code></pre>
<p>For more detailed information, see the <a href="https://www.mongodb.com/docs/manual/applications/indexes/">indexing strategies page</a>.</p>
<a href="#error-handling" id="error-handling" style="color: inherit; text-decoration: none;">
<h2>Error Handling</h2>
</a>
<p>If you need to filter certain errors from our driver we have a helpful tree of errors described in <a href="https://github.com/mongodb/node-mongodb-native/blob/HEAD/docs/errors.md">docs/errors.md</a>.</p>
<p>It is our recommendation to use <code>instanceof</code> checks on errors and to avoid relying on parsing <code>error.message</code> and <code>error.name</code> strings in your code.
We guarantee <code>instanceof</code> checks will pass according to semver guidelines, but errors may be sub-classed or their messages may change at any time, even patch releases, as we see fit to increase the helpfulness of the errors.</p>
<p>Any new errors we add to the driver will directly extend an existing error class and no existing error will be moved to a different parent class outside of a major release.
This means <code>instanceof</code> will always be able to accurately capture the errors that our driver throws (or returns in a callback).</p>
<pre><code class="language-typescript"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">client</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-2">MongoClient</span><span class="hl-0">(</span><span class="hl-6">url</span><span class="hl-0">);</span><br/><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">client</span><span class="hl-0">.</span><span class="hl-2">connect</span><span class="hl-0">();</span><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">collection</span><span class="hl-0"> = </span><span class="hl-6">client</span><span class="hl-0">.</span><span class="hl-2">db</span><span class="hl-0">().</span><span class="hl-2">collection</span><span class="hl-0">(</span><span class="hl-5">'collection'</span><span class="hl-0">);</span><br/><br/><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-6">collection</span><span class="hl-0">.</span><span class="hl-2">insertOne</span><span class="hl-0">({ </span><span class="hl-6">_id:</span><span class="hl-0"> </span><span class="hl-8">1</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-6">collection</span><span class="hl-0">.</span><span class="hl-2">insertOne</span><span class="hl-0">({ </span><span class="hl-6">_id:</span><span class="hl-0"> </span><span class="hl-8">1</span><span class="hl-0"> }); </span><span class="hl-1">// duplicate key error</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-3">instanceof</span><span class="hl-0"> </span><span class="hl-9">MongoServerError</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 worth logging: </span><span class="hl-3">${</span><span class="hl-6">error</span><span class="hl-3">}</span><span class="hl-5">`</span><span class="hl-0">); </span><span class="hl-1">// special case for some reason</span><br/><span class="hl-0"> }</span><br/><span class="hl-0"> </span><span class="hl-7">throw</span><span class="hl-0"> </span><span class="hl-6">error</span><span class="hl-0">; </span><span class="hl-1">// still want to crash</span><br/><span class="hl-0">}</span>
</code></pre>
<a href="#next-steps" id="next-steps" style="color: inherit; text-decoration: none;">
<h2>Next Steps</h2>
</a>
<ul>
<li><a href="https://www.mongodb.com/docs/manual/">MongoDB Documentation</a></li>
<li><a href="https://www.mongodb.com/docs/drivers/node/">MongoDB Node Driver Documentation</a></li>
<li><a href="https://www.mongodb.com/docs/manual/core/data-modeling-introduction/">Read about Schemas</a></li>
<li><a href="https://github.com/mongodb/node-mongodb-native">Star us on GitHub</a></li>
</ul>
<a href="#license" id="license" style="color: inherit; text-decoration: none;">
<h2>License</h2>
</a>
<p><a href="LICENSE.md">Apache 2.0</a></p>
<p>© 2009-2012 Christian Amor Kvalheim
© 2012-present MongoDB <a href="https://github.com/mongodb/node-mongodb-native/blob/HEAD/CONTRIBUTORS.md">Contributors</a></p>
</div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/AbstractCursor.html" class="tsd-kind-icon">Abstract<wbr/>Cursor</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/AbstractOperation.html" class="tsd-kind-icon">Abstract<wbr/>Operation</a></li><li class="tsd-kind-class"><a href="classes/Admin.html" class="tsd-kind-icon">Admin</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/AggregateOperation.html" class="tsd-kind-icon">Aggregate<wbr/>Operation</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/AggregationCursor.html" class="tsd-kind-icon">Aggregation<wbr/>Cursor</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/BSONRegExp.html" class="tsd-kind-icon">BSONReg<wbr/>Exp</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/BSONSymbol.html" class="tsd-kind-icon">BSONSymbol</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/Batch.html" class="tsd-kind-icon">Batch</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/Binary.html" class="tsd-kind-icon">Binary</a></li><li class="tsd-kind-class"><a href="classes/BufferPool.html" class="tsd-kind-icon">Buffer<wbr/>Pool</a></li><li class="tsd-kind-class"><a href="classes/BulkOperationBase.html" class="tsd-kind-icon">Bulk<wbr/>Operation<wbr/>Base</a></li><li class="tsd-kind-class"><a href="classes/BulkWriteResult.html" class="tsd-kind-icon">Bulk<wbr/>Write<wbr/>Result</a></li><li class="tsd-kind-class"><a href="classes/CancellationToken.html" class="tsd-kind-icon">Cancellation<wbr/>Token</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/ChangeStream.html" class="tsd-kind-icon">Change<wbr/>Stream</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/ChangeStreamCursor.html" class="tsd-kind-icon">Change<wbr/>Stream<wbr/>Cursor</a></li><li class="tsd-kind-class"><a href="classes/ClientSession.html" class="tsd-kind-icon">Client<wbr/>Session</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/Code.html" class="tsd-kind-icon">Code</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/Collection.html" class="tsd-kind-icon">Collection</a></li><li class="tsd-kind-class"><a href="classes/CommandFailedEvent.html" class="tsd-kind-icon">Command<wbr/>Failed<wbr/>Event</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/CommandOperation.html" class="tsd-kind-icon">Command<wbr/>Operation</a></li><li class="tsd-kind-class"><a href="classes/CommandStartedEvent.html" class="tsd-kind-icon">Command<wbr/>Started<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/CommandSucceededEvent.html" class="tsd-kind-icon">Command<wbr/>Succeeded<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/Connection.html" class="tsd-kind-icon">Connection</a></li><li class="tsd-kind-class"><a href="classes/ConnectionCheckOutFailedEvent.html" class="tsd-kind-icon">Connection<wbr/>Check<wbr/>Out<wbr/>Failed<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionCheckOutStartedEvent.html" class="tsd-kind-icon">Connection<wbr/>Check<wbr/>Out<wbr/>Started<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionCheckedInEvent.html" class="tsd-kind-icon">Connection<wbr/>Checked<wbr/>In<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionCheckedOutEvent.html" class="tsd-kind-icon">Connection<wbr/>Checked<wbr/>Out<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionClosedEvent.html" class="tsd-kind-icon">Connection<wbr/>Closed<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionCreatedEvent.html" class="tsd-kind-icon">Connection<wbr/>Created<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionPool.html" class="tsd-kind-icon">Connection<wbr/>Pool</a></li><li class="tsd-kind-class"><a href="classes/ConnectionPoolClearedEvent.html" class="tsd-kind-icon">Connection<wbr/>Pool<wbr/>Cleared<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionPoolClosedEvent.html" class="tsd-kind-icon">Connection<wbr/>Pool<wbr/>Closed<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionPoolCreatedEvent.html" class="tsd-kind-icon">Connection<wbr/>Pool<wbr/>Created<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionPoolMetrics.html" class="tsd-kind-icon">Connection<wbr/>Pool<wbr/>Metrics</a></li><li class="tsd-kind-class"><a href="classes/ConnectionPoolMonitoringEvent.html" class="tsd-kind-icon">Connection<wbr/>Pool<wbr/>Monitoring<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ConnectionReadyEvent.html" class="tsd-kind-icon">Connection<wbr/>Ready<wbr/>Event</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/DBRef.html" class="tsd-kind-icon">DBRef</a></li><li class="tsd-kind-class"><a href="classes/Db.html" class="tsd-kind-icon">Db</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/Decimal128.html" class="tsd-kind-icon">Decimal128</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/Double.html" class="tsd-kind-icon">Double</a></li><li class="tsd-kind-class"><a href="classes/Encrypter.html" class="tsd-kind-icon">Encrypter</a></li><li class="tsd-kind-class"><a href="classes/Explain.html" class="tsd-kind-icon">Explain</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/FindCursor.html" class="tsd-kind-icon">Find<wbr/>Cursor</a></li><li class="tsd-kind-class"><a href="classes/FindOperators.html" class="tsd-kind-icon">Find<wbr/>Operators</a></li><li class="tsd-kind-class"><a href="classes/GetMore.html" class="tsd-kind-icon">Get<wbr/>More</a></li><li class="tsd-kind-class"><a href="classes/GridFSBucket.html" class="tsd-kind-icon">GridFSBucket</a></li><li class="tsd-kind-class"><a href="classes/GridFSBucketReadStream.html" class="tsd-kind-icon">GridFSBucket<wbr/>Read<wbr/>Stream</a></li><li class="tsd-kind-class"><a href="classes/GridFSBucketWriteStream.html" class="tsd-kind-icon">GridFSBucket<wbr/>Write<wbr/>Stream</a></li><li class="tsd-kind-class"><a href="classes/HostAddress.html" class="tsd-kind-icon">Host<wbr/>Address</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/Int32.html" class="tsd-kind-icon">Int32</a></li><li class="tsd-kind-class"><a href="classes/KillCursor.html" class="tsd-kind-icon">Kill<wbr/>Cursor</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/ListCollectionsCursor.html" class="tsd-kind-icon">List<wbr/>Collections<wbr/>Cursor</a></li><li class="tsd-kind-class"><a href="classes/ListIndexesCursor.html" class="tsd-kind-icon">List<wbr/>Indexes<wbr/>Cursor</a></li><li class="tsd-kind-class"><a href="classes/Logger.html" class="tsd-kind-icon">Logger</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/Long.html" class="tsd-kind-icon">Long</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/MaxKey.html" class="tsd-kind-icon">Max<wbr/>Key</a></li><li class="tsd-kind-class"><a href="classes/MessageStream.html" class="tsd-kind-icon">Message<wbr/>Stream</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/MinKey.html" class="tsd-kind-icon">Min<wbr/>Key</a></li><li class="tsd-kind-class"><a href="classes/MongoAPIError.html" class="tsd-kind-icon">MongoAPIError</a></li><li class="tsd-kind-class"><a href="classes/MongoBatchReExecutionError.html" class="tsd-kind-icon">Mongo<wbr/>Batch<wbr/>Re<wbr/>Execution<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoBulkWriteError.html" class="tsd-kind-icon">Mongo<wbr/>Bulk<wbr/>Write<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoChangeStreamError.html" class="tsd-kind-icon">Mongo<wbr/>Change<wbr/>Stream<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoClient.html" class="tsd-kind-icon">Mongo<wbr/>Client</a></li><li class="tsd-kind-class"><a href="classes/MongoCompatibilityError.html" class="tsd-kind-icon">Mongo<wbr/>Compatibility<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoCredentials.html" class="tsd-kind-icon">Mongo<wbr/>Credentials</a></li><li class="tsd-kind-class"><a href="classes/MongoCursorExhaustedError.html" class="tsd-kind-icon">Mongo<wbr/>Cursor<wbr/>Exhausted<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoCursorInUseError.html" class="tsd-kind-icon">Mongo<wbr/>Cursor<wbr/>In<wbr/>Use<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoDBNamespace.html" class="tsd-kind-icon">MongoDBNamespace</a></li><li class="tsd-kind-class"><a href="classes/MongoDecompressionError.html" class="tsd-kind-icon">Mongo<wbr/>Decompression<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoDriverError.html" class="tsd-kind-icon">Mongo<wbr/>Driver<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoError.html" class="tsd-kind-icon">Mongo<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoExpiredSessionError.html" class="tsd-kind-icon">Mongo<wbr/>Expired<wbr/>Session<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoGridFSChunkError.html" class="tsd-kind-icon">Mongo<wbr/>GridFSChunk<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoGridFSStreamError.html" class="tsd-kind-icon">Mongo<wbr/>GridFSStream<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoInvalidArgumentError.html" class="tsd-kind-icon">Mongo<wbr/>Invalid<wbr/>Argument<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoKerberosError.html" class="tsd-kind-icon">Mongo<wbr/>Kerberos<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoMissingCredentialsError.html" class="tsd-kind-icon">Mongo<wbr/>Missing<wbr/>Credentials<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoMissingDependencyError.html" class="tsd-kind-icon">Mongo<wbr/>Missing<wbr/>Dependency<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoNetworkError.html" class="tsd-kind-icon">Mongo<wbr/>Network<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoNetworkTimeoutError.html" class="tsd-kind-icon">Mongo<wbr/>Network<wbr/>Timeout<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoNotConnectedError.html" class="tsd-kind-icon">Mongo<wbr/>Not<wbr/>Connected<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoParseError.html" class="tsd-kind-icon">Mongo<wbr/>Parse<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoRuntimeError.html" class="tsd-kind-icon">Mongo<wbr/>Runtime<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoServerClosedError.html" class="tsd-kind-icon">Mongo<wbr/>Server<wbr/>Closed<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoServerError.html" class="tsd-kind-icon">Mongo<wbr/>Server<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoServerSelectionError.html" class="tsd-kind-icon">Mongo<wbr/>Server<wbr/>Selection<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoSystemError.html" class="tsd-kind-icon">Mongo<wbr/>System<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoTopologyClosedError.html" class="tsd-kind-icon">Mongo<wbr/>Topology<wbr/>Closed<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoTransactionError.html" class="tsd-kind-icon">Mongo<wbr/>Transaction<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/MongoWriteConcernError.html" class="tsd-kind-icon">Mongo<wbr/>Write<wbr/>Concern<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/Monitor.html" class="tsd-kind-icon">Monitor</a></li><li class="tsd-kind-class"><a href="classes/Msg.html" class="tsd-kind-icon">Msg</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/ObjectId.html" class="tsd-kind-icon">Object<wbr/>Id</a></li><li class="tsd-kind-class"><a href="classes/OrderedBulkOperation.html" class="tsd-kind-icon">Ordered<wbr/>Bulk<wbr/>Operation</a></li><li class="tsd-kind-class"><a href="classes/Promise.html" class="tsd-kind-icon">Promise</a></li><li class="tsd-kind-class"><a href="classes/Query.html" class="tsd-kind-icon">Query</a></li><li class="tsd-kind-class"><a href="classes/RTTPinger.html" class="tsd-kind-icon">RTTPinger</a></li><li class="tsd-kind-class"><a href="classes/ReadConcern.html" class="tsd-kind-icon">Read<wbr/>Concern</a></li><li class="tsd-kind-class"><a href="classes/ReadPreference.html" class="tsd-kind-icon">Read<wbr/>Preference</a></li><li class="tsd-kind-class"><a href="classes/Server.html" class="tsd-kind-icon">Server</a></li><li class="tsd-kind-class"><a href="classes/ServerCapabilities.html" class="tsd-kind-icon">Server<wbr/>Capabilities</a></li><li class="tsd-kind-class"><a href="classes/ServerClosedEvent.html" class="tsd-kind-icon">Server<wbr/>Closed<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ServerDescription.html" class="tsd-kind-icon">Server<wbr/>Description</a></li><li class="tsd-kind-class"><a href="classes/ServerDescriptionChangedEvent.html" class="tsd-kind-icon">Server<wbr/>Description<wbr/>Changed<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ServerHeartbeatFailedEvent.html" class="tsd-kind-icon">Server<wbr/>Heartbeat<wbr/>Failed<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ServerHeartbeatStartedEvent.html" class="tsd-kind-icon">Server<wbr/>Heartbeat<wbr/>Started<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ServerHeartbeatSucceededEvent.html" class="tsd-kind-icon">Server<wbr/>Heartbeat<wbr/>Succeeded<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ServerOpeningEvent.html" class="tsd-kind-icon">Server<wbr/>Opening<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/ServerSession.html" class="tsd-kind-icon">Server<wbr/>Session</a></li><li class="tsd-kind-class"><a href="classes/ServerSessionPool.html" class="tsd-kind-icon">Server<wbr/>Session<wbr/>Pool</a></li><li class="tsd-kind-class"><a href="classes/SrvPoller.html" class="tsd-kind-icon">Srv<wbr/>Poller</a></li><li class="tsd-kind-class"><a href="classes/SrvPollingEvent.html" class="tsd-kind-icon">Srv<wbr/>Polling<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/StreamDescription.html" class="tsd-kind-icon">Stream<wbr/>Description</a></li><li class="tsd-kind-class tsd-is-external"><a href="classes/Timestamp.html" class="tsd-kind-icon">Timestamp</a></li><li class="tsd-kind-class"><a href="classes/Topology.html" class="tsd-kind-icon">Topology</a></li><li class="tsd-kind-class"><a href="classes/TopologyClosedEvent.html" class="tsd-kind-icon">Topology<wbr/>Closed<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/TopologyDescription.html" class="tsd-kind-icon">Topology<wbr/>Description</a></li><li class="tsd-kind-class"><a href="classes/TopologyDescriptionChangedEvent.html" class="tsd-kind-icon">Topology<wbr/>Description<wbr/>Changed<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/TopologyOpeningEvent.html" class="tsd-kind-icon">Topology<wbr/>Opening<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/Transaction.html" class="tsd-kind-icon">Transaction</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/TypedEventEmitter.html" class="tsd-kind-icon">Typed<wbr/>Event<wbr/>Emitter</a></li><li class="tsd-kind-class"><a href="classes/UnorderedBulkOperation.html" class="tsd-kind-icon">Unordered<wbr/>Bulk<wbr/>Operation</a></li><li class="tsd-kind-class"><a href="classes/WriteConcern.html" class="tsd-kind-icon">Write<wbr/>Concern</a></li><li class="tsd-kind-class"><a href="classes/WriteConcernError.html" class="tsd-kind-icon">Write<wbr/>Concern<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/WriteError.html" class="tsd-kind-icon">Write<wbr/>Error</a></li><li class="tsd-kind-interface"><a href="interfaces/AbstractCursorOptions.html" class="tsd-kind-icon">Abstract<wbr/>Cursor<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/AddUserOptions.html" class="tsd-kind-icon">Add<wbr/>User<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/AdminPrivate.html" class="tsd-kind-icon">Admin<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/AggregateOptions.html" class="tsd-kind-icon">Aggregate<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/AggregationCursorOptions.html" class="tsd-kind-icon">Aggregation<wbr/>Cursor<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/Auth.html" class="tsd-kind-icon">Auth</a></li><li class="tsd-kind-interface"><a href="interfaces/AuthMechanismProperties.html" class="tsd-kind-icon">Auth<wbr/>Mechanism<wbr/>Properties</a></li><li class="tsd-kind-interface"><a href="interfaces/AutoEncrypter.html" class="tsd-kind-icon">Auto<wbr/>Encrypter</a></li><li class="tsd-kind-interface"><a href="interfaces/AutoEncryptionOptions.html" class="tsd-kind-icon">Auto<wbr/>Encryption<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/BSONSerializeOptions.html" class="tsd-kind-icon">BSONSerialize<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/BulkOperationPrivate.html" class="tsd-kind-icon">Bulk<wbr/>Operation<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/BulkResult.html" class="tsd-kind-icon">Bulk<wbr/>Result</a></li><li class="tsd-kind-interface"><a href="interfaces/BulkWriteOperationError.html" class="tsd-kind-icon">Bulk<wbr/>Write<wbr/>Operation<wbr/>Error</a></li><li class="tsd-kind-interface"><a href="interfaces/BulkWriteOptions.html" class="tsd-kind-icon">Bulk<wbr/>Write<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ChangeStreamCursorOptions.html" class="tsd-kind-icon">Change<wbr/>Stream<wbr/>Cursor<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/ChangeStreamDocument.html" class="tsd-kind-icon">Change<wbr/>Stream<wbr/>Document</a></li><li class="tsd-kind-interface"><a href="interfaces/ChangeStreamOptions.html" class="tsd-kind-icon">Change<wbr/>Stream<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ClientMetadata.html" class="tsd-kind-icon">Client<wbr/>Metadata</a></li><li class="tsd-kind-interface"><a href="interfaces/ClientMetadataOptions.html" class="tsd-kind-icon">Client<wbr/>Metadata<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ClientSessionOptions.html" class="tsd-kind-icon">Client<wbr/>Session<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CloseOptions.html" class="tsd-kind-icon">Close<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ClusterTime.html" class="tsd-kind-icon">Cluster<wbr/>Time</a></li><li class="tsd-kind-interface"><a href="interfaces/CollStats.html" class="tsd-kind-icon">Coll<wbr/>Stats</a></li><li class="tsd-kind-interface"><a href="interfaces/CollStatsOptions.html" class="tsd-kind-icon">Coll<wbr/>Stats<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CollationOptions.html" class="tsd-kind-icon">Collation<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CollectionInfo.html" class="tsd-kind-icon">Collection<wbr/>Info</a></li><li class="tsd-kind-interface"><a href="interfaces/CollectionOptions.html" class="tsd-kind-icon">Collection<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CollectionPrivate.html" class="tsd-kind-icon">Collection<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/CommandOperationOptions.html" class="tsd-kind-icon">Command<wbr/>Operation<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CommandOptions.html" class="tsd-kind-icon">Command<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ConnectOptions.html" class="tsd-kind-icon">Connect<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ConnectionOptions.html" class="tsd-kind-icon">Connection<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ConnectionPoolOptions.html" class="tsd-kind-icon">Connection<wbr/>Pool<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CountDocumentsOptions.html" class="tsd-kind-icon">Count<wbr/>Documents<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CountOptions.html" class="tsd-kind-icon">Count<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CreateCollectionOptions.html" class="tsd-kind-icon">Create<wbr/>Collection<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CreateIndexesOptions.html" class="tsd-kind-icon">Create<wbr/>Indexes<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CursorCloseOptions.html" class="tsd-kind-icon">Cursor<wbr/>Close<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/CursorStreamOptions.html" class="tsd-kind-icon">Cursor<wbr/>Stream<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/DbOptions.html" class="tsd-kind-icon">Db<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/DbPrivate.html" class="tsd-kind-icon">Db<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/DbStatsOptions.html" class="tsd-kind-icon">Db<wbr/>Stats<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/DeleteManyModel.html" class="tsd-kind-icon">Delete<wbr/>Many<wbr/>Model</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/DeleteOneModel.html" class="tsd-kind-icon">Delete<wbr/>One<wbr/>Model</a></li><li class="tsd-kind-interface"><a href="interfaces/DeleteOptions.html" class="tsd-kind-icon">Delete<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/DeleteResult.html" class="tsd-kind-icon">Delete<wbr/>Result</a></li><li class="tsd-kind-interface"><a href="interfaces/DeleteStatement.html" class="tsd-kind-icon">Delete<wbr/>Statement</a></li><li class="tsd-kind-interface"><a href="interfaces/DestroyOptions.html" class="tsd-kind-icon">Destroy<wbr/>Options</a></li><li class="tsd-kind-interface tsd-is-external"><a href="interfaces/Document.html" class="tsd-kind-icon">Document</a></li><li class="tsd-kind-interface"><a href="interfaces/DriverInfo.html" class="tsd-kind-icon">Driver<wbr/>Info</a></li><li class="tsd-kind-interface"><a href="interfaces/EncrypterOptions.html" class="tsd-kind-icon">Encrypter<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/EndSessionOptions.html" class="tsd-kind-icon">End<wbr/>Session<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ErrorDescription.html" class="tsd-kind-icon">Error<wbr/>Description</a></li><li class="tsd-kind-interface"><a href="interfaces/EstimatedDocumentCountOptions.html" class="tsd-kind-icon">Estimated<wbr/>Document<wbr/>Count<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/EvalOptions.html" class="tsd-kind-icon">Eval<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ExecutionResult.html" class="tsd-kind-icon">Execution<wbr/>Result</a></li><li class="tsd-kind-interface"><a href="interfaces/ExplainOptions.html" class="tsd-kind-icon">Explain<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/FilterOperators.html" class="tsd-kind-icon">Filter<wbr/>Operators</a></li><li class="tsd-kind-interface"><a href="interfaces/FindOneAndDeleteOptions.html" class="tsd-kind-icon">Find<wbr/>One<wbr/>And<wbr/>Delete<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/FindOneAndReplaceOptions.html" class="tsd-kind-icon">Find<wbr/>One<wbr/>And<wbr/>Replace<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/FindOneAndUpdateOptions.html" class="tsd-kind-icon">Find<wbr/>One<wbr/>And<wbr/>Update<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/FindOptions.html" class="tsd-kind-icon">Find<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/GetMoreOptions.html" class="tsd-kind-icon">Get<wbr/>More<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/GridFSBucketOptions.html" class="tsd-kind-icon">GridFSBucket<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/GridFSBucketPrivate.html" class="tsd-kind-icon">GridFSBucket<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/GridFSBucketReadStreamOptions.html" class="tsd-kind-icon">GridFSBucket<wbr/>Read<wbr/>Stream<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/GridFSBucketReadStreamOptionsWithRevision.html" class="tsd-kind-icon">GridFSBucket<wbr/>Read<wbr/>Stream<wbr/>Options<wbr/>With<wbr/>Revision</a></li><li class="tsd-kind-interface"><a href="interfaces/GridFSBucketReadStreamPrivate.html" class="tsd-kind-icon">GridFSBucket<wbr/>Read<wbr/>Stream<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/GridFSBucketWriteStreamOptions.html" class="tsd-kind-icon">GridFSBucket<wbr/>Write<wbr/>Stream<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/GridFSChunk.html" class="tsd-kind-icon">GridFSChunk</a></li><li class="tsd-kind-interface"><a href="interfaces/GridFSFile.html" class="tsd-kind-icon">GridFSFile</a></li><li class="tsd-kind-interface"><a href="interfaces/HedgeOptions.html" class="tsd-kind-icon">Hedge<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/IndexDescription.html" class="tsd-kind-icon">Index<wbr/>Description</a></li><li class="tsd-kind-interface"><a href="interfaces/IndexInformationOptions.html" class="tsd-kind-icon">Index<wbr/>Information<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/InsertManyResult.html" class="tsd-kind-icon">Insert<wbr/>Many<wbr/>Result</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/InsertOneModel.html" class="tsd-kind-icon">Insert<wbr/>One<wbr/>Model</a></li><li class="tsd-kind-interface"><a href="interfaces/InsertOneOptions.html" class="tsd-kind-icon">Insert<wbr/>One<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/InsertOneResult.html" class="tsd-kind-icon">Insert<wbr/>One<wbr/>Result</a></li><li class="tsd-kind-interface"><a href="interfaces/InterruptibleAsyncInterval.html" class="tsd-kind-icon">Interruptible<wbr/>Async<wbr/>Interval</a></li><li class="tsd-kind-interface"><a href="interfaces/ListCollectionsOptions.html" class="tsd-kind-icon">List<wbr/>Collections<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ListDatabasesOptions.html" class="tsd-kind-icon">List<wbr/>Databases<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ListDatabasesResult.html" class="tsd-kind-icon">List<wbr/>Databases<wbr/>Result</a></li><li class="tsd-kind-interface"><a href="interfaces/ListIndexesOptions.html" class="tsd-kind-icon">List<wbr/>Indexes<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/LoggerOptions.html" class="tsd-kind-icon">Logger<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/MapReduceOptions.html" class="tsd-kind-icon">Map<wbr/>Reduce<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/MessageStreamOptions.html" class="tsd-kind-icon">Message<wbr/>Stream<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/ModifyResult.html" class="tsd-kind-icon">Modify<wbr/>Result</a></li><li class="tsd-kind-interface"><a href="interfaces/MongoClientOptions.html" class="tsd-kind-icon">Mongo<wbr/>Client<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/MongoClientPrivate.html" class="tsd-kind-icon">Mongo<wbr/>Client<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/MongoCredentialsOptions.html" class="tsd-kind-icon">Mongo<wbr/>Credentials<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/MongoNetworkErrorOptions.html" class="tsd-kind-icon">Mongo<wbr/>Network<wbr/>Error<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/MongoOptions.html" class="tsd-kind-icon">Mongo<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/MonitorOptions.html" class="tsd-kind-icon">Monitor<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/MonitorPrivate.html" class="tsd-kind-icon">Monitor<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/OpGetMoreOptions.html" class="tsd-kind-icon">Op<wbr/>Get<wbr/>More<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/OpQueryOptions.html" class="tsd-kind-icon">Op<wbr/>Query<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/OperationDescription.html" class="tsd-kind-icon">Operation<wbr/>Description</a></li><li class="tsd-kind-interface"><a href="interfaces/OperationOptions.html" class="tsd-kind-icon">Operation<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/OperationParent.html" class="tsd-kind-icon">Operation<wbr/>Parent</a></li><li class="tsd-kind-interface"><a href="interfaces/PipeOptions.html" class="tsd-kind-icon">Pipe<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/PkFactory.html" class="tsd-kind-icon">Pk<wbr/>Factory</a></li><li class="tsd-kind-interface"><a href="interfaces/QueryOptions.html" class="tsd-kind-icon">Query<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/RTTPingerOptions.html" class="tsd-kind-icon">RTTPinger<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ReadPreferenceFromOptions.html" class="tsd-kind-icon">Read<wbr/>Preference<wbr/>From<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ReadPreferenceLikeOptions.html" class="tsd-kind-icon">Read<wbr/>Preference<wbr/>Like<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ReadPreferenceOptions.html" class="tsd-kind-icon">Read<wbr/>Preference<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/RenameOptions.html" class="tsd-kind-icon">Rename<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/ReplaceOneModel.html" class="tsd-kind-icon">Replace<wbr/>One<wbr/>Model</a></li><li class="tsd-kind-interface"><a href="interfaces/ReplaceOptions.html" class="tsd-kind-icon">Replace<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ResumeOptions.html" class="tsd-kind-icon">Resume<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/RoleSpecification.html" class="tsd-kind-icon">Role<wbr/>Specification</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/RootFilterOperators.html" class="tsd-kind-icon">Root<wbr/>Filter<wbr/>Operators</a></li><li class="tsd-kind-interface"><a href="interfaces/SelectServerOptions.html" class="tsd-kind-icon">Select<wbr/>Server<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerApi.html" class="tsd-kind-icon">Server<wbr/>Api</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerDescriptionOptions.html" class="tsd-kind-icon">Server<wbr/>Description<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerPrivate.html" class="tsd-kind-icon">Server<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerSelectionRequest.html" class="tsd-kind-icon">Server<wbr/>Selection<wbr/>Request</a></li><li class="tsd-kind-interface"><a href="interfaces/SrvPollerOptions.html" class="tsd-kind-icon">Srv<wbr/>Poller<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/StreamDescriptionOptions.html" class="tsd-kind-icon">Stream<wbr/>Description<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/TimeSeriesCollectionOptions.html" class="tsd-kind-icon">Time<wbr/>Series<wbr/>Collection<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/TopologyDescriptionOptions.html" class="tsd-kind-icon">Topology<wbr/>Description<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/TopologyOptions.html" class="tsd-kind-icon">Topology<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/TopologyPrivate.html" class="tsd-kind-icon">Topology<wbr/>Private</a></li><li class="tsd-kind-interface"><a href="interfaces/TopologyVersion.html" class="tsd-kind-icon">Topology<wbr/>Version</a></li><li class="tsd-kind-interface"><a href="interfaces/TransactionOptions.html" class="tsd-kind-icon">Transaction<wbr/>Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/UpdateDescription.html" class="tsd-kind-icon">Update<wbr/>Description</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/UpdateManyModel.html" class="tsd-kind-icon">Update<wbr/>Many<wbr/>Model</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/UpdateOneModel.html" class="tsd-kind-icon">Update<wbr/>One<wbr/>Model</a></li><li class="tsd-kind-interface"><a href="interfaces/UpdateOptions.html" class="tsd-kind-icon">Update<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/UpdateResult.html" class="tsd-kind-icon">Update<wbr/>Result</a></li><li class="tsd-kind-interface"><a href="interfaces/UpdateStatement.html" class="tsd-kind-icon">Update<wbr/>Statement</a></li><li class="tsd-kind-interface"><a href="interfaces/ValidateCollectionOptions.html" class="tsd-kind-icon">Validate<wbr/>Collection<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/WaitQueueMember.html" class="tsd-kind-icon">Wait<wbr/>Queue<wbr/>Member</a></li><li class="tsd-kind-interface"><a href="interfaces/WiredTigerData.html" class="tsd-kind-icon">Wired<wbr/>Tiger<wbr/>Data</a></li><li class="tsd-kind-interface"><a href="interfaces/WriteConcernErrorData.html" class="tsd-kind-icon">Write<wbr/>Concern<wbr/>Error<wbr/>Data</a></li><li class="tsd-kind-interface"><a href="interfaces/WriteConcernOptions.html" class="tsd-kind-icon">Write<wbr/>Concern<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/WriteConcernSettings.html" class="tsd-kind-icon">Write<wbr/>Concern<wbr/>Settings</a></li><li class="tsd-kind-type-alias"><a href="modules.html#AbstractCursorEvents" class="tsd-kind-icon">Abstract<wbr/>Cursor<wbr/>Events</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#AcceptedFields" class="tsd-kind-icon">Accepted<wbr/>Fields</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#AddToSetOperators" class="tsd-kind-icon">Add<wbr/>To<wbr/>Set<wbr/>Operators</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#AlternativeType" class="tsd-kind-icon">Alternative<wbr/>Type</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#AnyBulkWriteOperation" class="tsd-kind-icon">Any<wbr/>Bulk<wbr/>Write<wbr/>Operation</a></li><li class="tsd-kind-type-alias"><a href="modules.html#AnyError" class="tsd-kind-icon">Any<wbr/>Error</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#ArrayOperator" class="tsd-kind-icon">Array<wbr/>Operator</a></li><li class="tsd-kind-type-alias"><a href="modules.html#AuthMechanism" class="tsd-kind-icon">Auth<wbr/>Mechanism</a></li><li class="tsd-kind-type-alias"><a href="modules.html#AutoEncryptionLoggerLevel" class="tsd-kind-icon">Auto<wbr/>Encryption<wbr/>Logger<wbr/>Level</a></li><li class="tsd-kind-type-alias"><a href="modules.html#BSONType" class="tsd-kind-icon">BSONType</a></li><li class="tsd-kind-type-alias"><a href="modules.html#BSONTypeAlias" class="tsd-kind-icon">BSONType<wbr/>Alias</a></li><li class="tsd-kind-type-alias"><a href="modules.html#BatchType" class="tsd-kind-icon">Batch<wbr/>Type</a></li><li class="tsd-kind-type-alias"><a href="modules.html#BitwiseFilter" class="tsd-kind-icon">Bitwise<wbr/>Filter</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#Callback" class="tsd-kind-icon">Callback</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#ChangeStreamEvents" class="tsd-kind-icon">Change<wbr/>Stream<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ClientSessionEvents" class="tsd-kind-icon">Client<wbr/>Session<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#CommonEvents" class="tsd-kind-icon">Common<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#Compressor" class="tsd-kind-icon">Compressor</a></li><li class="tsd-kind-type-alias"><a href="modules.html#CompressorName" class="tsd-kind-icon">Compressor<wbr/>Name</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#Condition" class="tsd-kind-icon">Condition</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ConnectionEvents" class="tsd-kind-icon">Connection<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ConnectionPoolEvents" class="tsd-kind-icon">Connection<wbr/>Pool<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#CursorFlag" class="tsd-kind-icon">Cursor<wbr/>Flag</a></li><li class="tsd-kind-type-alias"><a href="modules.html#DistinctOptions" class="tsd-kind-icon">Distinct<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#DropCollectionOptions" class="tsd-kind-icon">Drop<wbr/>Collection<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#DropDatabaseOptions" class="tsd-kind-icon">Drop<wbr/>Database<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#DropIndexesOptions" class="tsd-kind-icon">Drop<wbr/>Indexes<wbr/>Options</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#EnhancedOmit" class="tsd-kind-icon">Enhanced<wbr/>Omit</a></li><li class="tsd-kind-type-alias"><a href="modules.html#EventEmitterWithState" class="tsd-kind-icon">Event<wbr/>Emitter<wbr/>With<wbr/>State</a></li><li class="tsd-kind-type-alias"><a href="modules.html#EventsDescription" class="tsd-kind-icon">Events<wbr/>Description</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ExplainVerbosity" class="tsd-kind-icon">Explain<wbr/>Verbosity</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ExplainVerbosityLike" class="tsd-kind-icon">Explain<wbr/>Verbosity<wbr/>Like</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#Filter" class="tsd-kind-icon">Filter</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#FilterOperations" class="tsd-kind-icon">Filter<wbr/>Operations</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#FinalizeFunction" class="tsd-kind-icon">Finalize<wbr/>Function</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#Flatten" class="tsd-kind-icon">Flatten</a></li><li class="tsd-kind-type-alias"><a href="modules.html#GenericListener" class="tsd-kind-icon">Generic<wbr/>Listener</a></li><li class="tsd-kind-type-alias"><a href="modules.html#GridFSBucketEvents" class="tsd-kind-icon">GridFSBucket<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#Hint" class="tsd-kind-icon">Hint</a></li><li class="tsd-kind-type-alias"><a href="modules.html#IndexDirection" class="tsd-kind-icon">Index<wbr/>Direction</a></li><li class="tsd-kind-type-alias"><a href="modules.html#IndexSpecification" class="tsd-kind-icon">Index<wbr/>Specification</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#InferIdType" class="tsd-kind-icon">Infer<wbr/>Id<wbr/>Type</a></li><li class="tsd-kind-type-alias"><a href="modules.html#IntegerType" class="tsd-kind-icon">Integer<wbr/>Type</a></li><li class="tsd-kind-type-alias"><a href="modules.html#InternalAbstractCursorOptions" class="tsd-kind-icon">Internal<wbr/>Abstract<wbr/>Cursor<wbr/>Options</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#IsAny" class="tsd-kind-icon">Is<wbr/>Any</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#KeysOfAType" class="tsd-kind-icon">Keys<wbr/>OfAType</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#KeysOfOtherType" class="tsd-kind-icon">Keys<wbr/>Of<wbr/>Other<wbr/>Type</a></li><li class="tsd-kind-type-alias"><a href="modules.html#LoggerFunction" class="tsd-kind-icon">Logger<wbr/>Function</a></li><li class="tsd-kind-type-alias"><a href="modules.html#LoggerLevel" class="tsd-kind-icon">Logger<wbr/>Level</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#MapFunction" class="tsd-kind-icon">Map<wbr/>Function</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#MatchKeysAndValues" class="tsd-kind-icon">Match<wbr/>Keys<wbr/>And<wbr/>Values</a></li><li class="tsd-kind-type-alias"><a href="modules.html#MongoClientEvents" class="tsd-kind-icon">Mongo<wbr/>Client<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#MonitorEvents" class="tsd-kind-icon">Monitor<wbr/>Events</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#NotAcceptedFields" class="tsd-kind-icon">Not<wbr/>Accepted<wbr/>Fields</a></li><li class="tsd-kind-type-alias"><a href="modules.html#NumericType" class="tsd-kind-icon">Numeric<wbr/>Type</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#OneOrMore" class="tsd-kind-icon">One<wbr/>Or<wbr/>More</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#OnlyFieldsOfType" class="tsd-kind-icon">Only<wbr/>Fields<wbr/>Of<wbr/>Type</a></li><li class="tsd-kind-type-alias"><a href="modules.html#OperationTime" class="tsd-kind-icon">Operation<wbr/>Time</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#OptionalId" class="tsd-kind-icon">Optional<wbr/>Id</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ProfilingLevel" class="tsd-kind-icon">Profiling<wbr/>Level</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ProfilingLevelOptions" class="tsd-kind-icon">Profiling<wbr/>Level<wbr/>Options</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#Projection" class="tsd-kind-icon">Projection</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ProjectionOperators" class="tsd-kind-icon">Projection<wbr/>Operators</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#PullAllOperator" class="tsd-kind-icon">Pull<wbr/>All<wbr/>Operator</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#PullOperator" class="tsd-kind-icon">Pull<wbr/>Operator</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#PushOperator" class="tsd-kind-icon">Push<wbr/>Operator</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ReadConcernLevel" class="tsd-kind-icon">Read<wbr/>Concern<wbr/>Level</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ReadConcernLike" class="tsd-kind-icon">Read<wbr/>Concern<wbr/>Like</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ReadPreferenceLike" class="tsd-kind-icon">Read<wbr/>Preference<wbr/>Like</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ReadPreferenceMode" class="tsd-kind-icon">Read<wbr/>Preference<wbr/>Mode</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#ReduceFunction" class="tsd-kind-icon">Reduce<wbr/>Function</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#RegExpOrString" class="tsd-kind-icon">Reg<wbr/>Exp<wbr/>Or<wbr/>String</a></li><li class="tsd-kind-type-alias"><a href="modules.html#RemoveUserOptions" class="tsd-kind-icon">Remove<wbr/>User<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ResumeToken" class="tsd-kind-icon">Resume<wbr/>Token</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ReturnDocument" class="tsd-kind-icon">Return<wbr/>Document</a></li><li class="tsd-kind-type-alias"><a href="modules.html#RunCommandOptions" class="tsd-kind-icon">Run<wbr/>Command<wbr/>Options</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#SchemaMember" class="tsd-kind-icon">Schema<wbr/>Member</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerApiVersion" class="tsd-kind-icon">Server<wbr/>Api<wbr/>Version</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerEvents" class="tsd-kind-icon">Server<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerOptions" class="tsd-kind-icon">Server<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerSelectionCallback" class="tsd-kind-icon">Server<wbr/>Selection<wbr/>Callback</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerSelector" class="tsd-kind-icon">Server<wbr/>Selector</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerSessionId" class="tsd-kind-icon">Server<wbr/>Session<wbr/>Id</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerType" class="tsd-kind-icon">Server<wbr/>Type</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#SetFields" class="tsd-kind-icon">Set<wbr/>Fields</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SetProfilingLevelOptions" class="tsd-kind-icon">Set<wbr/>Profiling<wbr/>Level<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#Sort" class="tsd-kind-icon">Sort</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SortDirection" class="tsd-kind-icon">Sort<wbr/>Direction</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SortDirectionForCmd" class="tsd-kind-icon">Sort<wbr/>Direction<wbr/>For<wbr/>Cmd</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SortForCmd" class="tsd-kind-icon">Sort<wbr/>For<wbr/>Cmd</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SrvPollerEvents" class="tsd-kind-icon">Srv<wbr/>Poller<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#Stream" class="tsd-kind-icon">Stream</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SupportedNodeConnectionOptions" class="tsd-kind-icon">Supported<wbr/>Node<wbr/>Connection<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SupportedSocketOptions" class="tsd-kind-icon">Supported<wbr/>Socket<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SupportedTLSConnectionOptions" class="tsd-kind-icon">SupportedTLSConnection<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#SupportedTLSSocketOptions" class="tsd-kind-icon">SupportedTLSSocket<wbr/>Options</a></li><li class="tsd-kind-type-alias"><a href="modules.html#TagSet" class="tsd-kind-icon">Tag<wbr/>Set</a></li><li class="tsd-kind-type-alias"><a href="modules.html#TimerQueue" class="tsd-kind-icon">Timer<wbr/>Queue</a></li><li class="tsd-kind-type-alias"><a href="modules.html#TopologyEvents" class="tsd-kind-icon">Topology<wbr/>Events</a></li><li class="tsd-kind-type-alias"><a href="modules.html#TopologyType" class="tsd-kind-icon">Topology<wbr/>Type</a></li><li class="tsd-kind-type-alias"><a href="modules.html#TxnState" class="tsd-kind-icon">Txn<wbr/>State</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#UpdateFilter" class="tsd-kind-icon">Update<wbr/>Filter</a></li><li class="tsd-kind-type-alias"><a href="modules.html#W" class="tsd-kind-icon">W</a></li><li class="tsd-kind-type-alias"><a href="modules.html#WithConnectionCallback" class="tsd-kind-icon">With<wbr/>Connection<wbr/>Callback</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#WithId" class="tsd-kind-icon">With<wbr/>Id</a></li><li class="tsd-kind-type-alias"><a href="modules.html#WithSessionCallback" class="tsd-kind-icon">With<wbr/>Session<wbr/>Callback</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#WithTransactionCallback" class="tsd-kind-icon">With<wbr/>Transaction<wbr/>Callback</a></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><a href="modules.html#WithoutId" class="tsd-kind-icon">Without<wbr/>Id</a></li><li class="tsd-kind-type-alias"><a href="modules.html#WriteProtocolMessageType" class="tsd-kind-icon">Write<wbr/>Protocol<wbr/>Message<wbr/>Type</a></li><li class="tsd-kind-variable"><a href="modules.html#AuthMechanism" class="tsd-kind-icon">Auth<wbr/>Mechanism</a></li><li class="tsd-kind-variable"><a href="modules.html#AutoEncryptionLoggerLevel" class="tsd-kind-icon">Auto<wbr/>Encryption<wbr/>Logger<wbr/>Level</a></li><li class="tsd-kind-variable"><a href="modules.html#BSONType" class="tsd-kind-icon">BSONType</a></li><li class="tsd-kind-variable"><a href="modules.html#BatchType" class="tsd-kind-icon">Batch<wbr/>Type</a></li><li class="tsd-kind-variable"><a href="modules.html#CURSOR_FLAGS" class="tsd-kind-icon">CURSOR_<wbr/>FLAGS</a></li><li class="tsd-kind-variable"><a href="modules.html#Compressor" class="tsd-kind-icon">Compressor</a></li><li class="tsd-kind-variable"><a href="modules.html#DB_AGGREGATE_COLLECTION" class="tsd-kind-icon">DB_<wbr/>AGGREGATE_<wbr/>COLLECTION</a></li><li class="tsd-kind-variable"><a href="modules.html#ExplainVerbosity" class="tsd-kind-icon">Explain<wbr/>Verbosity</a></li><li class="tsd-kind-variable"><a href="modules.html#LEGAL_TCP_SOCKET_OPTIONS" class="tsd-kind-icon">LEGAL_<wbr/>TCP_<wbr/>SOCKET_<wbr/>OPTIONS</a></li><li class="tsd-kind-variable"><a href="modules.html#LEGAL_TLS_SOCKET_OPTIONS" class="tsd-kind-icon">LEGAL_<wbr/>TLS_<wbr/>SOCKET_<wbr/>OPTIONS</a></li><li class="tsd-kind-variable"><a href="modules.html#LoggerLevel" class="tsd-kind-icon">Logger<wbr/>Level</a></li><li class="tsd-kind-variable"><a href="modules.html#MONGO_CLIENT_EVENTS" class="tsd-kind-icon">MONGO_<wbr/>CLIENT_<wbr/>EVENTS</a></li><li class="tsd-kind-variable tsd-is-external"><a href="modules.html#Map" class="tsd-kind-icon">Map</a></li><li class="tsd-kind-variable"><a href="modules.html#ObjectID" class="tsd-kind-icon">ObjectID</a></li><li class="tsd-kind-variable"><a href="modules.html#ProfilingLevel" class="tsd-kind-icon">Profiling<wbr/>Level</a></li><li class="tsd-kind-variable"><a href="modules.html#ReadConcernLevel" class="tsd-kind-icon">Read<wbr/>Concern<wbr/>Level</a></li><li class="tsd-kind-variable"><a href="modules.html#ReadPreferenceMode" class="tsd-kind-icon">Read<wbr/>Preference<wbr/>Mode</a></li><li class="tsd-kind-variable"><a href="modules.html#ReturnDocument" class="tsd-kind-icon">Return<wbr/>Document</a></li><li class="tsd-kind-variable"><a href="modules.html#ServerApiVersion" class="tsd-kind-icon">Server<wbr/>Api<wbr/>Version</a></li><li class="tsd-kind-variable"><a href="modules.html#ServerType" class="tsd-kind-icon">Server<wbr/>Type</a></li><li class="tsd-kind-variable"><a href="modules.html#TopologyType" class="tsd-kind-icon">Topology<wbr/>Type</a></li><li class="tsd-kind-variable"><a href="modules.html#TxnState" class="tsd-kind-icon">Txn<wbr/>State</a></li><li class="tsd-kind-function"><a href="modules.html#deserialize" class="tsd-kind-icon">deserialize</a></li><li class="tsd-kind-function"><a href="modules.html#serialize" class="tsd-kind-icon">serialize</a></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-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><li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited 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-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private 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></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>