-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathAdmin.html
77 lines (77 loc) · 36.3 KB
/
Admin.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
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Admin | 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="Admin.html">Admin</a></li></ul><h1>Class Admin</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>Admin</strong> class is an internal class that allows convenient access to
the admin functionality and commands for MongoDB.</p>
</div><div><p><strong>ADMIN Cannot directly be instantiated</strong></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">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">admin</span><span class="hl-0"> = </span><span class="hl-6">client</span><span class="hl-0">.</span><span class="hl-2">db</span><span class="hl-0">().</span><span class="hl-2">admin</span><span class="hl-0">();</span><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">dbInfo</span><span class="hl-0"> = </span><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">admin</span><span class="hl-0">.</span><span class="hl-2">listDatabases</span><span class="hl-0">();</span><br/><span class="hl-7">for</span><span class="hl-0"> (</span><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">db</span><span class="hl-0"> </span><span class="hl-3">of</span><span class="hl-0"> </span><span class="hl-6">dbInfo</span><span class="hl-0">.</span><span class="hl-6">databases</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-6">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">db</span><span class="hl-0">.</span><span class="hl-6">name</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">Admin</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>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#addUser" class="tsd-kind-icon">add<wbr/>User</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#buildInfo" class="tsd-kind-icon">build<wbr/>Info</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#command" class="tsd-kind-icon">command</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#listDatabases" class="tsd-kind-icon">list<wbr/>Databases</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#ping" class="tsd-kind-icon">ping</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#removeUser" class="tsd-kind-icon">remove<wbr/>User</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#replSetGetStatus" class="tsd-kind-icon">repl<wbr/>Set<wbr/>Get<wbr/>Status</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#serverInfo" class="tsd-kind-icon">server<wbr/>Info</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#serverStatus" class="tsd-kind-icon">server<wbr/>Status</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#validateCollection" class="tsd-kind-icon">validate<wbr/>Collection</a></li></ul></section></div></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>, passwordOrOptions<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</a>, 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/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L128">src/admin.ts:128</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Add a user to the database</p>
</div><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Use the createUser command in <code>db.command()</code> instead.</p>
</dd><dt>see</dt><dd><p><a href="https://www.mongodb.com/docs/manual/reference/command/createUser/">https://www.mongodb.com/docs/manual/reference/command/createUser/</a></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><div class="tsd-comment tsd-typography"><div class="lead">
<p>The username for the new user</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> passwordOrOptions: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>An optional password for the new user, or the options for the command</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/AddUserOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">AddUserOptions</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="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="buildInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">build<wbr/>Info<a href="#buildInfo" 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">build<wbr/>Info<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><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L88">src/admin.ts:88</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Retrieve the server build information</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><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/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, options<span class="tsd-signature-symbol">?: </span><a href="../modules.html#RunCommandOptions" class="tsd-signature-type" data-tsd-kind="Type alias">RunCommandOptions</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/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L76">src/admin.ts:76</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Execute a command</p>
</div><div><p>The driver will ensure the following fields are attached to the command sent to the server:</p>
<ul>
<li><code>lsid</code> - sourced from an implicit session or options.session</li>
<li><code>$readPreference</code> - defaults to primary or can be configured by options.readPreference</li>
<li><code>$db</code> - sourced from the name of this database</li>
</ul>
<p>If the client has a serverApi setting:</p>
<ul>
<li><code>apiVersion</code></li>
<li><code>apiStrict</code></li>
<li><code>apiDeprecationErrors</code></li>
</ul>
<p>When in a transaction:</p>
<ul>
<li><code>readConcern</code> - sourced from readConcern set on the TransactionOptions</li>
<li><code>writeConcern</code> - sourced from writeConcern set on the TransactionOptions</li>
</ul>
<p>Attaching any of the above fields to the command will have no effect as the driver will overwrite the value.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>command: <a href="../interfaces/BSON.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 execute</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../modules.html#RunCommandOptions" class="tsd-signature-type" data-tsd-kind="Type alias">RunCommandOptions</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="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="listDatabases" class="tsd-anchor"></a><h3 class="tsd-anchor-link">list<wbr/>Databases<a href="#listDatabases" 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">list<wbr/>Databases<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/ListDatabasesOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListDatabasesOptions</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/ListDatabasesResult.html" class="tsd-signature-type" data-tsd-kind="Interface">ListDatabasesResult</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L180">src/admin.ts:180</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>List the available databases</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/ListDatabasesOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ListDatabasesOptions</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="../interfaces/ListDatabasesResult.html" class="tsd-signature-type" data-tsd-kind="Interface">ListDatabasesResult</a><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="ping" class="tsd-anchor"></a><h3 class="tsd-anchor-link">ping<a href="#ping" 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">ping<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><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L115">src/admin.ts:115</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Ping the MongoDB server and retrieve results</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><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>, 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></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L152">src/admin.ts:152</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><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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><span class="tsd-signature-type">boolean</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="replSetGetStatus" class="tsd-anchor"></a><h3 class="tsd-anchor-link">repl<wbr/>Set<wbr/>Get<wbr/>Status<a href="#replSetGetStatus" 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">repl<wbr/>Set<wbr/>Get<wbr/>Status<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><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L189">src/admin.ts:189</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get ReplicaSet status</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="serverInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">server<wbr/>Info<a href="#serverInfo" 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">server<wbr/>Info<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><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L97">src/admin.ts:97</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Retrieve the server build information</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="serverStatus" class="tsd-anchor"></a><h3 class="tsd-anchor-link">server<wbr/>Status<a href="#serverStatus" 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">server<wbr/>Status<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><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L106">src/admin.ts:106</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Retrieve this db's server status.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/CommandOperationOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandOperationOptions</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="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="validateCollection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">validate<wbr/>Collection<a href="#validateCollection" 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">validate<wbr/>Collection<span class="tsd-signature-symbol">(</span>collectionName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/ValidateCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ValidateCollectionOptions</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/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v5.4.0/src/admin.ts#L165">src/admin.ts:165</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Validate an existing collection</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>collectionName: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The name of the collection to validate.</p>
</div></div></li><li><h5>options: <a href="../interfaces/ValidateCollectionOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ValidateCollectionOptions</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 <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li><li class="label tsd-is-external"><span>Internals</span></li><li class="label tsd-is-external"><span>Externals</span></li><li class=" tsd-kind-namespace tsd-is-external"><a href="../modules/BSON.html">BSON</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="Admin.html" class="tsd-kind-icon">Admin</a><ul><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#addUser" class="tsd-kind-icon">add<wbr/>User</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#buildInfo" class="tsd-kind-icon">build<wbr/>Info</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#command" class="tsd-kind-icon">command</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#listDatabases" class="tsd-kind-icon">list<wbr/>Databases</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#ping" class="tsd-kind-icon">ping</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#removeUser" class="tsd-kind-icon">remove<wbr/>User</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#replSetGetStatus" class="tsd-kind-icon">repl<wbr/>Set<wbr/>Get<wbr/>Status</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#serverInfo" class="tsd-kind-icon">server<wbr/>Info</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#serverStatus" class="tsd-kind-icon">server<wbr/>Status</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Admin.html#validateCollection" class="tsd-kind-icon">validate<wbr/>Collection</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>