-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Db.html
143 lines (143 loc) · 175 KB
/
Db.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
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Db | 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="Db.html">Db</a></li></ul><h1>Class Db</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>The <strong>Db</strong> class is a class that represents a MongoDB Database.</p>
</div><dl class="tsd-comment-tags"><dt>example</dt><dd><pre><code class="language-ts"><span class="hl-7">import</span><span class="hl-0"> { </span><span class="hl-6">MongoClient</span><span class="hl-0"> } </span><span class="hl-7">from</span><span class="hl-0"> </span><span class="hl-5">'mongodb'</span><span class="hl-0">;</span><br/><br/><span class="hl-3">interface</span><span class="hl-0"> </span><span class="hl-9">Pet</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-6">name</span><span class="hl-0">: </span><span class="hl-9">string</span><span class="hl-0">;</span><br/><span class="hl-0"> </span><span class="hl-6">kind</span><span class="hl-0">: </span><span class="hl-5">'dog'</span><span class="hl-0"> | </span><span class="hl-5">'cat'</span><span class="hl-0"> | </span><span class="hl-5">'fish'</span><span class="hl-0">;</span><br/><span class="hl-0">}</span><br/><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-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">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><br/><br/><span class="hl-1">// Create a collection that validates our union</span><br/><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">db</span><span class="hl-0">.</span><span class="hl-2">createCollection</span><span class="hl-0"><</span><span class="hl-9">Pet</span><span class="hl-0">>(</span><span class="hl-5">'pets'</span><span class="hl-0">, {</span><br/><span class="hl-0"> </span><span class="hl-6">validator:</span><span class="hl-0"> { </span><span class="hl-6">$expr:</span><span class="hl-0"> { </span><span class="hl-6">$in:</span><span class="hl-0"> [</span><span class="hl-5">'$kind'</span><span class="hl-0">, [</span><span class="hl-5">'dog'</span><span class="hl-0">, </span><span class="hl-5">'cat'</span><span class="hl-0">, </span><span class="hl-5">'fish'</span><span class="hl-0">]] } }</span><br/><span class="hl-0">})</span>
</code></pre>
</dd></dl></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Db</span></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>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="Db.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_COMMAND_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>COMMAND_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_INDEX_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>INDEX_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_JS_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>JS_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_NAMESPACE_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>NAMESPACE_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_PROFILE_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>PROFILE_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_USER_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>USER_<wbr/>COLLECTION</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="Db.html#bsonOptions" class="tsd-kind-icon">bson<wbr/>Options</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#databaseName" class="tsd-kind-icon">database<wbr/>Name</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#logger" class="tsd-kind-icon">logger</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#namespace" class="tsd-kind-icon">namespace</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#options" class="tsd-kind-icon">options</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#readConcern" class="tsd-kind-icon">read<wbr/>Concern</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#readPreference" class="tsd-kind-icon">read<wbr/>Preference</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#secondaryOk" class="tsd-kind-icon">secondary<wbr/>Ok</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#slaveOk" class="tsd-kind-icon">slave<wbr/>Ok</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#writeConcern" class="tsd-kind-icon">write<wbr/>Concern</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="Db.html#addUser" class="tsd-kind-icon">add<wbr/>User</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#admin" class="tsd-kind-icon">admin</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#aggregate" class="tsd-kind-icon">aggregate</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#collection" class="tsd-kind-icon">collection</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#collections" class="tsd-kind-icon">collections</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#command" class="tsd-kind-icon">command</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#createCollection" class="tsd-kind-icon">create<wbr/>Collection</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#createIndex" class="tsd-kind-icon">create<wbr/>Index</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#dropCollection" class="tsd-kind-icon">drop<wbr/>Collection</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#dropDatabase" class="tsd-kind-icon">drop<wbr/>Database</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#getLogger" class="tsd-kind-icon">get<wbr/>Logger</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#indexInformation" class="tsd-kind-icon">index<wbr/>Information</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#listCollections" class="tsd-kind-icon">list<wbr/>Collections</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#profilingLevel" class="tsd-kind-icon">profiling<wbr/>Level</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#removeUser" class="tsd-kind-icon">remove<wbr/>User</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#renameCollection" class="tsd-kind-icon">rename<wbr/>Collection</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#setProfilingLevel" class="tsd-kind-icon">set<wbr/>Profiling<wbr/>Level</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#stats" class="tsd-kind-icon">stats</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#unref" class="tsd-kind-icon">unref</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#watch" class="tsd-kind-icon">watch</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link">constructor<a href="#constructor" 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-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Db<span class="tsd-signature-symbol">(</span>client<span class="tsd-signature-symbol">: </span><a href="MongoClient.html" class="tsd-signature-type" data-tsd-kind="Class">MongoClient</a>, databaseName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/DbOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DbOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Db.html" class="tsd-signature-type" data-tsd-kind="Class">Db</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/main/src/db.ts#L148">src/db.ts:148</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Creates a new Db instance</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>client: <a href="MongoClient.html" class="tsd-signature-type" data-tsd-kind="Class">MongoClient</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The MongoClient for the database.</p>
</div></div></li><li><h5>databaseName: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The name of the database this instance represents.</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/DbOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DbOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional settings for Db construction</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="Db.html" class="tsd-signature-type" data-tsd-kind="Class">Db</a></h4></li></ul></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 tsd-is-static"><a id="SYSTEM_COMMAND_COLLECTION" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> SYSTEM_<wbr/>COMMAND_<wbr/>COLLECTION<a href="#SYSTEM_COMMAND_COLLECTION" 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">SYSTEM_<wbr/>COMMAND_<wbr/>COLLECTION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = CONSTANTS.SYSTEM_COMMAND_COLLECTION</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L138">src/db.ts:138</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static"><a id="SYSTEM_INDEX_COLLECTION" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> SYSTEM_<wbr/>INDEX_<wbr/>COLLECTION<a href="#SYSTEM_INDEX_COLLECTION" 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">SYSTEM_<wbr/>INDEX_<wbr/>COLLECTION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = CONSTANTS.SYSTEM_INDEX_COLLECTION</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L135">src/db.ts:135</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static"><a id="SYSTEM_JS_COLLECTION" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> SYSTEM_<wbr/>JS_<wbr/>COLLECTION<a href="#SYSTEM_JS_COLLECTION" 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">SYSTEM_<wbr/>JS_<wbr/>COLLECTION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = CONSTANTS.SYSTEM_JS_COLLECTION</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L139">src/db.ts:139</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static"><a id="SYSTEM_NAMESPACE_COLLECTION" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> SYSTEM_<wbr/>NAMESPACE_<wbr/>COLLECTION<a href="#SYSTEM_NAMESPACE_COLLECTION" 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">SYSTEM_<wbr/>NAMESPACE_<wbr/>COLLECTION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L134">src/db.ts:134</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static"><a id="SYSTEM_PROFILE_COLLECTION" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> SYSTEM_<wbr/>PROFILE_<wbr/>COLLECTION<a href="#SYSTEM_PROFILE_COLLECTION" 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">SYSTEM_<wbr/>PROFILE_<wbr/>COLLECTION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = CONSTANTS.SYSTEM_PROFILE_COLLECTION</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L136">src/db.ts:136</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static"><a id="SYSTEM_USER_COLLECTION" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> SYSTEM_<wbr/>USER_<wbr/>COLLECTION<a href="#SYSTEM_USER_COLLECTION" 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">SYSTEM_<wbr/>USER_<wbr/>COLLECTION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = CONSTANTS.SYSTEM_USER_COLLECTION</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L137">src/db.ts:137</a></li></ul></aside></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="bsonOptions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">bson<wbr/>Options<a href="#bsonOptions" 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> bsonOptions<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/BSONSerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BSONSerializeOptions</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/main/src/db.ts#L219">src/db.ts:219</a></li></ul></aside><h4 class="tsd-returns-title">Returns <a href="../interfaces/BSONSerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BSONSerializeOptions</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="databaseName" class="tsd-anchor"></a><h3 class="tsd-anchor-link">database<wbr/>Name<a href="#databaseName" 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> databaseName<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></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/main/src/db.ts#L179">src/db.ts:179</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="logger" class="tsd-anchor"></a><h3 class="tsd-anchor-link">logger<a href="#logger" 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> logger<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Logger.html" class="tsd-signature-type" data-tsd-kind="Class">Logger</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/main/src/db.ts#L782">src/db.ts:782</a></li></ul></aside><h4 class="tsd-returns-title">Returns <a href="Logger.html" class="tsd-signature-type" data-tsd-kind="Class">Logger</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="namespace" class="tsd-anchor"></a><h3 class="tsd-anchor-link">namespace<a href="#namespace" 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> namespace<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></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/main/src/db.ts#L228">src/db.ts:228</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="options" class="tsd-anchor"></a><h3 class="tsd-anchor-link">options<a href="#options" 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> options<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="../interfaces/DbOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DbOptions</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/main/src/db.ts#L184">src/db.ts:184</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/DbOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DbOptions</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="readConcern" class="tsd-anchor"></a><h3 class="tsd-anchor-link">read<wbr/>Concern<a href="#readConcern" 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> readConcern<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="ReadConcern.html" class="tsd-signature-type" data-tsd-kind="Class">ReadConcern</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/main/src/db.ts#L203">src/db.ts:203</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="ReadConcern.html" class="tsd-signature-type" data-tsd-kind="Class">ReadConcern</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="readPreference" class="tsd-anchor"></a><h3 class="tsd-anchor-link">read<wbr/>Preference<a href="#readPreference" 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> readPreference<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</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/main/src/db.ts#L211">src/db.ts:211</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>The current readPreference of the Db. If not explicitly defined for
this Db, will be inherited from the parent MongoClient</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="secondaryOk" class="tsd-anchor"></a><h3 class="tsd-anchor-link">secondary<wbr/>Ok<a href="#secondaryOk" 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> secondaryOk<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/main/src/db.ts#L199">src/db.ts:199</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Check if a secondary can be used (because the read preference is <em>not</em> set to primary)</p>
</div></div><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="slaveOk" class="tsd-anchor"></a><h3 class="tsd-anchor-link">slave<wbr/>Ok<a href="#slaveOk" 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> slaveOk<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/main/src/db.ts#L192">src/db.ts:192</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>slaveOk specified</p>
</div><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Use secondaryOk instead</p>
</dd></dl></div><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="writeConcern" class="tsd-anchor"></a><h3 class="tsd-anchor-link">write<wbr/>Concern<a href="#writeConcern" 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> writeConcern<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="WriteConcern.html" class="tsd-signature-type" data-tsd-kind="Class">WriteConcern</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/main/src/db.ts#L224">src/db.ts:224</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="WriteConcern.html" class="tsd-signature-type" data-tsd-kind="Class">WriteConcern</a></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="addUser" class="tsd-anchor"></a><h3 class="tsd-anchor-link">add<wbr/>User<a href="#addUser" 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">add<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</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/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">add<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, password<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</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/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">add<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</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><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">add<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, password<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</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><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">add<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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><li class="tsd-signature tsd-kind-icon">add<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, password<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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><li class="tsd-signature tsd-kind-icon">add<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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><li class="tsd-signature tsd-kind-icon">add<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, password<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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/main/src/db.ts#L582">src/db.ts:582</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Add a user to the database</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The username for the new user</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L583">src/db.ts:583</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>password: <span class="tsd-signature-type">string</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L584">src/db.ts:584</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L585">src/db.ts:585</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>password: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L587">src/db.ts:587</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L589">src/db.ts:589</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>password: <span class="tsd-signature-type">string</span></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L591">src/db.ts:591</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L593">src/db.ts:593</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>password: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="admin" class="tsd-anchor"></a><h3 class="tsd-anchor-link">admin<a href="#admin" 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">admin<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Admin.html" class="tsd-signature-type" data-tsd-kind="Class">Admin</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/main/src/db.ts#L329">src/db.ts:329</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the Admin db instance</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="Admin.html" class="tsd-signature-type" data-tsd-kind="Class">Admin</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a id="aggregate" class="tsd-anchor"></a><h3 class="tsd-anchor-link">aggregate<a href="#aggregate" 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">aggregate<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>pipeline<span class="tsd-signature-symbol">?: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">[]</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/AggregateOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AggregateOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="AggregationCursor.html" class="tsd-signature-type" data-tsd-kind="Class">AggregationCursor</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></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/main/src/db.ts#L306">src/db.ts:306</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Execute an aggregation framework pipeline against the database, needs MongoDB >= 3.6</p>
</div></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>T<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>pipeline: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>An array of aggregation stages to be executed</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/AggregateOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AggregateOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional settings for the command</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="AggregationCursor.html" class="tsd-signature-type" data-tsd-kind="Class">AggregationCursor</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></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a id="collection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collection<a href="#collection" 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">collection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/CollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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/main/src/db.ts#L339">src/db.ts:339</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly.</p>
</div></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the collection name we wish to access.</p>
</div></div></li><li><h5>options: <a href="../interfaces/CollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionOptions</a><span class="tsd-signature-symbol"> = {}</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span></h4><div><p>return the new Collection instance</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="collections" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collections<a href="#collections" 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">collections<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="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">collections<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</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><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">collections<span class="tsd-signature-symbol">(</span>callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-signature tsd-kind-icon">collections<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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-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/main/src/db.ts#L517">src/db.ts:517</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Fetch all collections for the current db.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L518">src/db.ts:518</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L520">src/db.ts:520</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></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><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L522">src/db.ts:522</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="command" class="tsd-anchor"></a><h3 class="tsd-anchor-link">command<a href="#command" 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">command<span class="tsd-signature-symbol">(</span>command<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</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><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">command<span class="tsd-signature-symbol">(</span>command<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">command<span class="tsd-signature-symbol">(</span>command<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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><li class="tsd-signature tsd-kind-icon">command<span class="tsd-signature-symbol">(</span>command<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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/main/src/db.ts#L279">src/db.ts:279</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Execute a command</p>
</div><dl class="tsd-comment-tags"><dt>remarks</dt><dd><p>This command does not inherit options from the MongoClient.</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>command: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The command to run</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L280">src/db.ts:280</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>command: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5></li><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L282">src/db.ts:282</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>command: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L284">src/db.ts:284</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>command: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5></li><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a id="createCollection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">create<wbr/>Collection<a href="#createCollection" 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">create<wbr/>Collection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/CreateCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CreateCollectionOptions</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><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">create<wbr/>Collection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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><li class="tsd-signature tsd-kind-icon">create<wbr/>Collection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>name<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">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/CreateCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CreateCollectionOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L240">src/db.ts:240</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Create a new collection on a server with the specified options. Use this to create capped collections.
More information about command options available at <a href="https://docs.mongodb.com/manual/reference/command/create/">https://docs.mongodb.com/manual/reference/command/create/</a></p>
</div></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The name of the collection to create</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/CreateCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CreateCollectionOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional settings for the command</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L245">src/db.ts:245</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L250">src/db.ts:250</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/CreateCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CreateCollectionOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="createIndex" class="tsd-anchor"></a><h3 class="tsd-anchor-link">create<wbr/>Index<a href="#createIndex" 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">create<wbr/>Index<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, indexSpec<span class="tsd-signature-symbol">: </span><a href="../modules.html#IndexSpecification" class="tsd-signature-type" data-tsd-kind="Type alias">IndexSpecification</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">string</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">create<wbr/>Index<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, indexSpec<span class="tsd-signature-symbol">: </span><a href="../modules.html#IndexSpecification" class="tsd-signature-type" data-tsd-kind="Type alias">IndexSpecification</a>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CreateIndexesOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CreateIndexesOptions</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">string</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">create<wbr/>Index<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, indexSpec<span class="tsd-signature-symbol">: </span><a href="../modules.html#IndexSpecification" class="tsd-signature-type" data-tsd-kind="Type alias">IndexSpecification</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><li class="tsd-signature tsd-kind-icon">create<wbr/>Index<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, indexSpec<span class="tsd-signature-symbol">: </span><a href="../modules.html#IndexSpecification" class="tsd-signature-type" data-tsd-kind="Type alias">IndexSpecification</a>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CreateIndexesOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CreateIndexesOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L544">src/db.ts:544</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Creates an index on the db and collection.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Name of the collection to create the index on.</p>
</div></div></li><li><h5>indexSpec: <a href="../modules.html#IndexSpecification" class="tsd-signature-type" data-tsd-kind="Type alias">IndexSpecification</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Specify the field to index, or an index specification</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">string</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L545">src/db.ts:545</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>indexSpec: <a href="../modules.html#IndexSpecification" class="tsd-signature-type" data-tsd-kind="Type alias">IndexSpecification</a></h5></li><li><h5>options: <a href="../interfaces/CreateIndexesOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CreateIndexesOptions</a></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">string</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L551">src/db.ts:551</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>indexSpec: <a href="../modules.html#IndexSpecification" class="tsd-signature-type" data-tsd-kind="Type alias">IndexSpecification</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L553">src/db.ts:553</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>indexSpec: <a href="../modules.html#IndexSpecification" class="tsd-signature-type" data-tsd-kind="Type alias">IndexSpecification</a></h5></li><li><h5>options: <a href="../interfaces/CreateIndexesOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CreateIndexesOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="dropCollection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">drop<wbr/>Collection<a href="#dropCollection" 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">drop<wbr/>Collection<span class="tsd-signature-symbol">(</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-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">drop<wbr/>Collection<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/DropCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DropCollectionOptions</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">boolean</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">drop<wbr/>Collection<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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><li class="tsd-signature tsd-kind-icon">drop<wbr/>Collection<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/DropCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DropCollectionOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L466">src/db.ts:466</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Drop a collection from the database, removing it permanently. New accesses will create a new collection.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Name of collection to drop</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">boolean</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L467">src/db.ts:467</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/DropCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DropCollectionOptions</a></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">boolean</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L469">src/db.ts:469</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L471">src/db.ts:471</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/DropCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DropCollectionOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="dropDatabase" class="tsd-anchor"></a><h3 class="tsd-anchor-link">drop<wbr/>Database<a href="#dropDatabase" 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">drop<wbr/>Database<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><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">drop<wbr/>Database<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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">boolean</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">drop<wbr/>Database<span class="tsd-signature-symbol">(</span>callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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><li class="tsd-signature tsd-kind-icon">drop<wbr/>Database<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L492">src/db.ts:492</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Drop a database, removing it permanently from the server.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L493">src/db.ts:493</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></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">boolean</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L495">src/db.ts:495</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L497">src/db.ts:497</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="getLogger" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Logger<a href="#getLogger" 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">get<wbr/>Logger<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Logger.html" class="tsd-signature-type" data-tsd-kind="Class">Logger</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/main/src/db.ts#L778">src/db.ts:778</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the db logger</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="Logger.html" class="tsd-signature-type" data-tsd-kind="Class">Logger</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="indexInformation" class="tsd-anchor"></a><h3 class="tsd-anchor-link">index<wbr/>Information<a href="#indexInformation" 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">index<wbr/>Information<span class="tsd-signature-symbol">(</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-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">index<wbr/>Information<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/IndexInformationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">IndexInformationOptions</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><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">index<wbr/>Information<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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><li class="tsd-signature tsd-kind-icon">index<wbr/>Information<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/IndexInformationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">IndexInformationOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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/main/src/db.ts#L717">src/db.ts:717</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Retrieves this collections index info.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The name of the collection.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L718">src/db.ts:718</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/IndexInformationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">IndexInformationOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L720">src/db.ts:720</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L722">src/db.ts:722</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/IndexInformationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">IndexInformationOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a id="listCollections" class="tsd-anchor"></a><h3 class="tsd-anchor-link">list<wbr/>Collections<a href="#listCollections" 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">list<wbr/>Collections<span class="tsd-signature-symbol">(</span>filter<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">{ </span>nameOnly<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ListCollectionsCursor.html" class="tsd-signature-type" data-tsd-kind="Class">ListCollectionsCursor</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Pick</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/CollectionInfo.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionInfo</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"type"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"name"</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">list<wbr/>Collections<span class="tsd-signature-symbol">(</span>filter<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">{ </span>nameOnly<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ListCollectionsCursor.html" class="tsd-signature-type" data-tsd-kind="Class">ListCollectionsCursor</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/CollectionInfo.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionInfo</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">list<wbr/>Collections<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>filter<span class="tsd-signature-symbol">?: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ListCollectionsCursor.html" class="tsd-signature-type" data-tsd-kind="Class">ListCollectionsCursor</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></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/main/src/db.ts#L380">src/db.ts:380</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>List all collections of this database with optional filter</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>filter: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Query to filter collections by</p>
</div></div></li><li><h5>options: <a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">{ </span>nameOnly<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol"> }</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional settings for the command</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="ListCollectionsCursor.html" class="tsd-signature-type" data-tsd-kind="Class">ListCollectionsCursor</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Pick</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/CollectionInfo.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionInfo</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"type"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"name"</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L384">src/db.ts:384</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>filter: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5></li><li><h5>options: <a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">{ </span>nameOnly<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> }</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ListCollectionsCursor.html" class="tsd-signature-type" data-tsd-kind="Class">ListCollectionsCursor</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/CollectionInfo.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionInfo</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L388">src/db.ts:388</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>T<span class="tsd-signature-symbol">: </span><a href="../interfaces/CollectionInfo.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionInfo</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Pick</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/CollectionInfo.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionInfo</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"type"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"name"</span><span class="tsd-signature-symbol">></span> = <a href="../interfaces/CollectionInfo.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionInfo</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Pick</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/CollectionInfo.html" class="tsd-signature-type" data-tsd-kind="Interface">CollectionInfo</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"type"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"name"</span><span class="tsd-signature-symbol">></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> filter: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/ListCollectionsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListCollectionsOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ListCollectionsCursor.html" class="tsd-signature-type" data-tsd-kind="Class">ListCollectionsCursor</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></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="profilingLevel" class="tsd-anchor"></a><h3 class="tsd-anchor-link">profiling<wbr/>Level<a href="#profilingLevel" 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">profiling<wbr/>Level<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><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">profiling<wbr/>Level<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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">string</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">profiling<wbr/>Level<span class="tsd-signature-symbol">(</span>callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><li class="tsd-signature tsd-kind-icon">profiling<wbr/>Level<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L691">src/db.ts:691</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Retrieve the current profiling Level for MongoDB</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L692">src/db.ts:692</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></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">string</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L694">src/db.ts:694</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L696">src/db.ts:696</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="removeUser" class="tsd-anchor"></a><h3 class="tsd-anchor-link">remove<wbr/>User<a href="#removeUser" 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">remove<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</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">boolean</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">remove<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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">boolean</span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">remove<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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><li class="tsd-signature tsd-kind-icon">remove<wbr/>User<span class="tsd-signature-symbol">(</span>username<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L631">src/db.ts:631</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Remove a user from a database</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The username to remove</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">boolean</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L632">src/db.ts:632</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></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">boolean</span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L634">src/db.ts:634</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L636">src/db.ts:636</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>username: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a id="renameCollection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">rename<wbr/>Collection<a href="#renameCollection" 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">rename<wbr/>Collection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>fromCollection<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, toCollection<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</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="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">rename<wbr/>Collection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>fromCollection<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, toCollection<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/RenameOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">RenameOptions</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><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">rename<wbr/>Collection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>fromCollection<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, toCollection<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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><li class="tsd-signature tsd-kind-icon">rename<wbr/>Collection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>fromCollection<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, toCollection<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/RenameOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">RenameOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L412">src/db.ts:412</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Rename a collection.</p>
</div><dl class="tsd-comment-tags"><dt>remarks</dt><dd><p>This operation does not inherit options from the MongoClient.</p>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>fromCollection: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Name of current collection to rename</p>
</div></div></li><li><h5>toCollection: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>New name of of the collection</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L416">src/db.ts:416</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>fromCollection: <span class="tsd-signature-type">string</span></h5></li><li><h5>toCollection: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/RenameOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">RenameOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L422">src/db.ts:422</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>fromCollection: <span class="tsd-signature-type">string</span></h5></li><li><h5>toCollection: <span class="tsd-signature-type">string</span></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L428">src/db.ts:428</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>fromCollection: <span class="tsd-signature-type">string</span></h5></li><li><h5>toCollection: <span class="tsd-signature-type">string</span></h5></li><li><h5>options: <a href="../interfaces/RenameOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">RenameOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="Collection.html" class="tsd-signature-type" data-tsd-kind="Class">Collection</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="setProfilingLevel" class="tsd-anchor"></a><h3 class="tsd-anchor-link">set<wbr/>Profiling<wbr/>Level<a href="#setProfilingLevel" 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">set<wbr/>Profiling<wbr/>Level<span class="tsd-signature-symbol">(</span>level<span class="tsd-signature-symbol">: </span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</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><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">set<wbr/>Profiling<wbr/>Level<span class="tsd-signature-symbol">(</span>level<span class="tsd-signature-symbol">: </span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">set<wbr/>Profiling<wbr/>Level<span class="tsd-signature-symbol">(</span>level<span class="tsd-signature-symbol">: </span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a><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><li class="tsd-signature tsd-kind-icon">set<wbr/>Profiling<wbr/>Level<span class="tsd-signature-symbol">(</span>level<span class="tsd-signature-symbol">: </span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a><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/main/src/db.ts#L658">src/db.ts:658</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Set the current profiling level of MongoDB</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>level: <a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The new profiling level (off, slow_only, all).</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L659">src/db.ts:659</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>level: <a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a></h5></li><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L664">src/db.ts:664</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>level: <a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L666">src/db.ts:666</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>level: <a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a></h5></li><li><h5>options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../modules.html#ProfilingLevel" class="tsd-signature-type" data-tsd-kind="Variable">ProfilingLevel</a><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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="stats" class="tsd-anchor"></a><h3 class="tsd-anchor-link">stats<a href="#stats" 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">stats<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/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">stats<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/DbStatsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DbStatsOptions</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><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">stats<span class="tsd-signature-symbol">(</span>callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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><li class="tsd-signature tsd-kind-icon">stats<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/DbStatsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DbStatsOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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/main/src/db.ts#L356">src/db.ts:356</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get all the db statistics.</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/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L357">src/db.ts:357</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <a href="../interfaces/DbStatsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DbStatsOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L359">src/db.ts:359</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/main/src/db.ts#L361">src/db.ts:361</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <a href="../interfaces/DbStatsOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DbStatsOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><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 class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="unref" class="tsd-anchor"></a><h3 class="tsd-anchor-link">unref<a href="#unref" 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">unref<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/main/src/db.ts#L745">src/db.ts:745</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Unref all sockets</p>
</div><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>This function is deprecated and will be removed in the next major version.</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"><a id="watch" class="tsd-anchor"></a><h3 class="tsd-anchor-link">watch<a href="#watch" 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">watch<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TChange</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>pipeline<span class="tsd-signature-symbol">?: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">[]</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/ChangeStreamOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ChangeStreamOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ChangeStream.html" class="tsd-signature-type" data-tsd-kind="Class">ChangeStream</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TChange</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/main/src/db.ts#L764">src/db.ts:764</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Create a new Change Stream, watching for new changes (insertions, updates,
replacements, deletions, and invalidations) in this database. Will ignore all
changes to system collections.</p>
</div><dl class="tsd-comment-tags"><dt>remarks</dt><dd><p>watch() accepts two generic arguments for distinct use cases:</p>
<ul>
<li>The first is to provide the schema that may be defined for all the collections within this database</li>
<li>The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument</li>
</ul>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>TSchema<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4><div class="tsd-comment tsd-typography"><div class="lead">
<p>Type of the data being detected by the change stream</p>
</div></div></li><li><h4>TChange<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a> = <a href="../modules.html#ChangeStreamDocument" class="tsd-signature-type" data-tsd-kind="Type alias">ChangeStreamDocument</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="lead">
<p>Type of the whole change stream document emitted</p>
</div></div></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>pipeline: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>An array of <a href="https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/" class="external">aggregation pipeline stages</a> through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.</p>
</div></div></li><li><h5>options: <a href="../interfaces/ChangeStreamOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ChangeStreamOptions</a><span class="tsd-signature-symbol"> = {}</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional settings for the command</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="ChangeStream.html" class="tsd-signature-type" data-tsd-kind="Class">ChangeStream</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TSchema</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TChange</span><span class="tsd-signature-symbol">></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></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="Db.html" class="tsd-kind-icon">Db</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="Db.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_COMMAND_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>COMMAND_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_INDEX_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>INDEX_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_JS_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>JS_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_NAMESPACE_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>NAMESPACE_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_PROFILE_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>PROFILE_<wbr/>COLLECTION</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="Db.html#SYSTEM_USER_COLLECTION" class="tsd-kind-icon">SYSTEM_<wbr/>USER_<wbr/>COLLECTION</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#bsonOptions" class="tsd-kind-icon">bson<wbr/>Options</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#databaseName" class="tsd-kind-icon">database<wbr/>Name</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#logger" class="tsd-kind-icon">logger</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#namespace" class="tsd-kind-icon">namespace</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#options" class="tsd-kind-icon">options</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#readConcern" class="tsd-kind-icon">read<wbr/>Concern</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#readPreference" class="tsd-kind-icon">read<wbr/>Preference</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#secondaryOk" class="tsd-kind-icon">secondary<wbr/>Ok</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#slaveOk" class="tsd-kind-icon">slave<wbr/>Ok</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Db.html#writeConcern" class="tsd-kind-icon">write<wbr/>Concern</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#addUser" class="tsd-kind-icon">add<wbr/>User</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#admin" class="tsd-kind-icon">admin</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#aggregate" class="tsd-kind-icon">aggregate</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#collection" class="tsd-kind-icon">collection</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#collections" class="tsd-kind-icon">collections</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#command" class="tsd-kind-icon">command</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#createCollection" class="tsd-kind-icon">create<wbr/>Collection</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#createIndex" class="tsd-kind-icon">create<wbr/>Index</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#dropCollection" class="tsd-kind-icon">drop<wbr/>Collection</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#dropDatabase" class="tsd-kind-icon">drop<wbr/>Database</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#getLogger" class="tsd-kind-icon">get<wbr/>Logger</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#indexInformation" class="tsd-kind-icon">index<wbr/>Information</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#listCollections" class="tsd-kind-icon">list<wbr/>Collections</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#profilingLevel" class="tsd-kind-icon">profiling<wbr/>Level</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#removeUser" class="tsd-kind-icon">remove<wbr/>User</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#renameCollection" class="tsd-kind-icon">rename<wbr/>Collection</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#setProfilingLevel" class="tsd-kind-icon">set<wbr/>Profiling<wbr/>Level</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#stats" class="tsd-kind-icon">stats</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Db.html#unref" class="tsd-kind-icon">unref</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Db.html#watch" class="tsd-kind-icon">watch</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></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>